diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-07-17 12:07:25 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-07-20 14:44:59 -0300 |
commit | 8ff9daf3c16769817d0eaf16154d9e9198ec1bda (patch) | |
tree | 6855397d115ef614648ce42456b6c5f59682cef7 /tools/perf/util/strlist.h | |
parent | 4a77e2183fc0260c0efc7adeccf933fef893ad5f (diff) | |
download | linux-8ff9daf3c16769817d0eaf16154d9e9198ec1bda.tar.bz2 |
perf strlist: Allow substitutions from file contents in a given directory
So, if we have an strlist equal to:
"file,close"
And we call it as:
struct strlist_config *config = { .dirname = "~/strace/groups", };
struct strlist *slist = strlist__new("file, close", &config);
And we have:
$ cat ~/strace/groups/file
access
open
openat
statfs
Then the resulting strlist will have these contents:
[ "access", "open", "openat", "statfs", "close" ]
This will be used to implement strace syscall groups in 'perf trace',
but can be used in some other tool, thus being implemented in 'strlist'.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-wi6l6qtomqlywwr6005jvs05@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/strlist.h')
-rw-r--r-- | tools/perf/util/strlist.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h index a182785d9428..9bb9823268b8 100644 --- a/tools/perf/util/strlist.h +++ b/tools/perf/util/strlist.h @@ -18,6 +18,7 @@ struct strlist { struct strlist_config { bool dont_dupstr; + const char *dirname; }; struct strlist *strlist__new(const char *slist, const struct strlist_config *config); @@ -79,5 +80,5 @@ static inline struct str_node *strlist__next(struct str_node *sn) for (pos = strlist__first(slist), n = strlist__next(pos); pos;\ pos = n, n = strlist__next(n)) -int strlist__parse_list(struct strlist *slist, const char *s); +int strlist__parse_list(struct strlist *slist, const char *s, const char *subst_dir); #endif /* __PERF_STRLIST_H */ |