diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-20 12:05:38 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-06-20 12:05:38 -0300 |
commit | 2157f6ee18ce5224eea2b27582368b60d940bef6 (patch) | |
tree | e1c7d6b95338d0ac1391b6ceb1bfa3894051b1b7 /tools/perf/util/util.c | |
parent | 007b811b4041989ec2dc91b9614aa2c41332723e (diff) | |
download | linux-2157f6ee18ce5224eea2b27582368b60d940bef6.tar.bz2 |
perf evsel: Adopt find_process()
And make it static, nobody else uses it, if we ever need it in more
places we can carve a new source file for process related methods,
for now lets reduce util.{c,h} a tad more.
Link: http://lkml.kernel.org/n/tip-zgb28rllvypjibw52aaz9p15@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.c')
-rw-r--r-- | tools/perf/util/util.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 28c9f335006c..3cd42995ac6f 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -343,43 +343,6 @@ int perf_event_paranoid(void) return value; } - -bool find_process(const char *name) -{ - size_t len = strlen(name); - DIR *dir; - struct dirent *d; - int ret = -1; - - dir = opendir(procfs__mountpoint()); - if (!dir) - return false; - - /* Walk through the directory. */ - while (ret && (d = readdir(dir)) != NULL) { - char path[PATH_MAX]; - char *data; - size_t size; - - if ((d->d_type != DT_DIR) || - !strcmp(".", d->d_name) || - !strcmp("..", d->d_name)) - continue; - - scnprintf(path, sizeof(path), "%s/%s/comm", - procfs__mountpoint(), d->d_name); - - if (filename__read_str(path, &data, &size)) - continue; - - ret = strncmp(name, data, len); - free(data); - } - - closedir(dir); - return ret ? false : true; -} - static int fetch_ubuntu_kernel_version(unsigned int *puint) { |