summaryrefslogtreecommitdiff
path: root/tools/perf/util/strlist.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-07-17 18:07:25 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-07-20 20:44:59 +0300
commit8ff9daf3c16769817d0eaf16154d9e9198ec1bda (patch)
tree6855397d115ef614648ce42456b6c5f59682cef7 /tools/perf/util/strlist.h
parent4a77e2183fc0260c0efc7adeccf933fef893ad5f (diff)
downloadlinux-8ff9daf3c16769817d0eaf16154d9e9198ec1bda.tar.xz
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 */