lkml.org 
[lkml]   [2020]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5] perf tools: add support for libpfm4
On Mon, Mar 23, 2020 at 04:58:46PM -0700, Ian Rogers wrote:

SNIP

> +
> +int parse_libpfm_events_option(const struct option *opt, const char *str,
> + int unset __maybe_unused)
> +{
> + struct evlist *evlist = *(struct evlist **)opt->value;
> + struct perf_event_attr attr;
> + struct perf_pmu *pmu;
> + struct evsel *evsel, *grp_leader = NULL;
> + char *p, *q, *p_orig;
> + const char *sep;
> + int grp_evt = -1;
> + int ret;
> +
> + p_orig = p = strdup(str);
> + if (!p)
> + return -1;
> + /*
> + * force loading of the PMU list
> + */
> + perf_pmu__scan(NULL);
> +
> + for (q = p; strsep(&p, ",{}"); q = p) {

it seems like this code could be really easily testtable,
could you please write simple test for this?

thanks,
jirka

\
 
 \ /
  Last update: 2020-03-24 11:28    [W:0.122 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site