summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/strlist.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-07-17 17:07:25 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-07-20 19:44:59 +0200
commit8ff9daf3c16769817d0eaf16154d9e9198ec1bda (patch)
tree6855397d115ef614648ce42456b6c5f59682cef7 /tools/perf/util/strlist.h
parentperf strlist: Make dupstr be the default and part of an extensible config parm (diff)
downloadlinux-8ff9daf3c16769817d0eaf16154d9e9198ec1bda.tar.xz
linux-8ff9daf3c16769817d0eaf16154d9e9198ec1bda.zip
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.h3
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 */