Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf tools: Remove some unused functions

Probably are there since the beginning, taken from git but never used.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-lr65jeefffjeaywoapps9a6i@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+2 -69
-4
tools/perf/util/cache.h
··· 32 32 u64 perf_config_u64(const char *, const char *); 33 33 int perf_config_bool(const char *, const char *); 34 34 int config_error_nonbool(const char *); 35 - const char *perf_config_dirname(const char *, const char *); 36 35 const char *perf_etc_perfconfig(void); 37 36 38 37 char *alias_lookup(const char *alias); ··· 44 45 return path[0] == '/'; 45 46 } 46 47 47 - char *strip_path_suffix(const char *path, const char *suffix); 48 - 49 48 char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2))); 50 - char *perf_path(const char *fmt, ...) __attribute__((format (printf, 1, 2))); 51 49 52 50 #endif /* __PERF_CACHE_H */
+1 -1
tools/perf/util/config.c
··· 372 372 return !!perf_config_bool_or_int(name, value, &discard); 373 373 } 374 374 375 - const char *perf_config_dirname(const char *name, const char *value) 375 + static const char *perf_config_dirname(const char *name, const char *value) 376 376 { 377 377 if (!name) 378 378 return NULL;
+1 -64
tools/perf/util/path.c
··· 14 14 15 15 static char bad_path[] = "/bad-path/"; 16 16 /* 17 - * Two hacks: 17 + * One hack: 18 18 */ 19 - 20 - static const char *get_perf_dir(void) 21 - { 22 - return "."; 23 - } 24 - 25 19 static char *get_pathname(void) 26 20 { 27 21 static char pathname_array[4][PATH_MAX]; ··· 47 53 if (len >= PATH_MAX) 48 54 return bad_path; 49 55 return cleanup_path(pathname); 50 - } 51 - 52 - char *perf_path(const char *fmt, ...) 53 - { 54 - const char *perf_dir = get_perf_dir(); 55 - char *pathname = get_pathname(); 56 - va_list args; 57 - unsigned len; 58 - 59 - len = strlen(perf_dir); 60 - if (len > PATH_MAX-100) 61 - return bad_path; 62 - memcpy(pathname, perf_dir, len); 63 - if (len && perf_dir[len-1] != '/') 64 - pathname[len++] = '/'; 65 - va_start(args, fmt); 66 - len += vsnprintf(pathname + len, PATH_MAX - len, fmt, args); 67 - va_end(args); 68 - if (len >= PATH_MAX) 69 - return bad_path; 70 - return cleanup_path(pathname); 71 - } 72 - 73 - /* strip arbitrary amount of directory separators at end of path */ 74 - static inline int chomp_trailing_dir_sep(const char *path, int len) 75 - { 76 - while (len && is_dir_sep(path[len - 1])) 77 - len--; 78 - return len; 79 - } 80 - 81 - /* 82 - * If path ends with suffix (complete path components), returns the 83 - * part before suffix (sans trailing directory separators). 84 - * Otherwise returns NULL. 85 - */ 86 - char *strip_path_suffix(const char *path, const char *suffix) 87 - { 88 - int path_len = strlen(path), suffix_len = strlen(suffix); 89 - 90 - while (suffix_len) { 91 - if (!path_len) 92 - return NULL; 93 - 94 - if (is_dir_sep(path[path_len - 1])) { 95 - if (!is_dir_sep(suffix[suffix_len - 1])) 96 - return NULL; 97 - path_len = chomp_trailing_dir_sep(path, path_len); 98 - suffix_len = chomp_trailing_dir_sep(suffix, suffix_len); 99 - } 100 - else if (path[--path_len] != suffix[--suffix_len]) 101 - return NULL; 102 - } 103 - 104 - if (path_len && !is_dir_sep(path[path_len - 1])) 105 - return NULL; 106 - return strndup(path, chomp_trailing_dir_sep(path, path_len)); 107 56 }