Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1158105

Re: [PATCHv2 0/9] perf stat: Separate shadow counters code

From Jiri Olsa <jolsa@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCHv2 0/9] perf stat: Separate shadow counters code
Date 2015-06-04 00:40 +0200
Message-ID <pxpuh-6vh-9@gated-at.bofh.it> (permalink)
References <pxhQ5-3FJ-7@gated-at.bofh.it> <pxp1f-5W6-11@gated-at.bofh.it> <pxpkC-6jA-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jun 03, 2015 at 07:24:53PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Jun 03, 2015 at 07:07:05PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Wed, Jun 03, 2015 at 04:25:50PM +0200, Jiri Olsa escreveu:
> > > hi,
> > > sending cleanup/move of shadow counters. I need it
> > > for my other changes of stat scripting, but I think
> > > it can stand alone as a cleanup.
> > > 
> > > v2 changes:
> > >   - move evsel id into 'struct perf_stat'
> > >     and change the id functions namespace
> > 
> > Thanks, applied.
> 
> 15: struct perf_event_attr setup                             :sh: line 1: 27101 Segmentation fault      (core dumped) PERF_TEST_ATTR=/tmp/tmptb9pWi /home/acme/bin/perf stat -o /tmp/tmptb9pWi/perf.data kill > /dev/null 2>&1
> sh: line 1: 27104 Segmentation fault      (core dumped) PERF_TEST_ATTR=/tmp/tmpWgRK9D /home/acme/bin/perf stat -o /tmp/tmpWgRK9D/perf.data -d kill > /dev/null 2>&1
> sh: line 1: 27107 Segmentation fault      (core dumped) PERF_TEST_ATTR=/tmp/tmpmCOyBe /home/acme/bin/perf stat -o /tmp/tmpmCOyBe/perf.data -dd kill > /dev/null 2>&1
> sh: line 1: 27110 Segmentation fault      (core dumped) PERF_TEST_ATTR=/tmp/tmpJP9x2e /home/acme/bin/perf stat -o /tmp/tmpJP9x2e/perf.data -ddd kill > /dev/null 2>&1
>  Ok
> 
> Can you please check?

arghh.. sry, I remember running tests :-\ really ;-)
it's the -d default events that do not set evsel->name

attached patch fixes it, but I'll send v3 for the first patch

thanks,
jirka


---
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index d22791d02db0..dba762da5679 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -88,7 +88,7 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel)
 	/* ps->id is 0 hence PERF_STAT_EVSEL_ID__NONE by default */
 
 	for (i = 0; i < PERF_STAT_EVSEL_ID__MAX; i++) {
-		if (!strcmp(evsel->name, id_str[i])) {
+		if (evsel->name && !strcmp(evsel->name, id_str[i])) {
 			ps->id = i;
 			break;
 		}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCHv2 0/9] perf stat: Separate shadow counters code Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-06-04 00:30 +0200
  Re: [PATCHv2 0/9] perf stat: Separate shadow counters code Jiri Olsa <jolsa@redhat.com> - 2015-06-04 00:40 +0200
    Re: [PATCHv2 0/9] perf stat: Separate shadow counters code Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-06-04 00:50 +0200

csiph-web