summaryrefslogtreecommitdiff
path: root/tools/perf/util/strlist.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-07-20 18:13:34 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-07-20 18:13:34 +0300
commit4a77e2183fc0260c0efc7adeccf933fef893ad5f (patch)
treeb4edd7039b862d167043ae80ee18c720368b14c3 /tools/perf/util/strlist.c
parentab7322af8c620987ed058e39506c97e5f2d3c65c (diff)
downloadlinux-4a77e2183fc0260c0efc7adeccf933fef893ad5f.tar.xz
perf strlist: Make dupstr be the default and part of an extensible config parm
So that we can pass more info to strlist__new() without having to change its function signature, just adding entries to the strlist_config struct with sensible defaults for when those fields are not specified. 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-5uaaler4931i0s9sedxjquhq@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/strlist.c')
-rw-r--r--tools/perf/util/strlist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/strlist.c b/tools/perf/util/strlist.c
index 68ae673f9fb6..dd403850dfab 100644
--- a/tools/perf/util/strlist.c
+++ b/tools/perf/util/strlist.c
@@ -133,7 +133,7 @@ int strlist__parse_list(struct strlist *slist, const char *s)
return *s ? strlist__parse_list_entry(slist, s) : 0;
}
-struct strlist *strlist__new(bool dupstr, const char *list)
+struct strlist *strlist__new(const char *list, const struct strlist_config *config)
{
struct strlist *slist = malloc(sizeof(*slist));
@@ -143,7 +143,7 @@ struct strlist *strlist__new(bool dupstr, const char *list)
slist->rblist.node_new = strlist__node_new;
slist->rblist.node_delete = strlist__node_delete;
- slist->dupstr = dupstr;
+ slist->dupstr = config ? !config->dont_dupstr : true;
if (list && strlist__parse_list(slist, list) != 0)
goto out_error;
}