public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: David Ahern <dsahern@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	Ingo Molnar <mingo@kernel.org>,
	linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 14/17] perf header: Set tracepoint event name only if not set
Date: Thu, 06 Sep 2012 10:30:37 +0900	[thread overview]
Message-ID: <87oblkc4zm.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <5047E7CC.6040408@gmail.com> (David Ahern's message of "Wed, 05 Sep 2012 18:01:16 -0600")

On Wed, 05 Sep 2012 18:01:16 -0600, David Ahern wrote:
> On 9/5/12 5:08 PM, Arnaldo Carvalho de Melo wrote:
>> From: Namhyung Kim <namhyung.kim@lge.com>
>>
>> The event name can be set already by processing a event_desc data.
>>
>> So check it before setting to prevent possible leak.
>>
>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>> Cc: Ingo Molnar <mingo@kernel.org>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
>> Link: http://lkml.kernel.org/r/1346821373-31621-3-git-send-email-namhyung@kernel.org
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>> ---
>>   tools/perf/util/header.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
>> index a124b93..05c9310 100644
>> --- a/tools/perf/util/header.c
>> +++ b/tools/perf/util/header.c
>> @@ -2314,7 +2314,7 @@ static int perf_evlist__set_tracepoint_names(struct perf_evlist *evlist,
>>   	struct perf_evsel *pos;
>>
>>   	list_for_each_entry(pos, &evlist->entries, node) {
>> -		if (pos->attr.type == PERF_TYPE_TRACEPOINT &&
>> +		if (pos->attr.type == PERF_TYPE_TRACEPOINT && !pos->name &&
>>   		    perf_evsel__set_tracepoint_name(pos, pevent))
>>   			return -1;
>>   	}
>>
>
> I'm getting a segfault running perf-script due to this patch. Most
> likely this is exposing another problem. Back trace is:

Hmm.  It's because evsel->tp_format being not set, not sure why I didn't
detect this during tests.  Will find out a solution.

Thanks,
Namhyung


>
> #0  0x000000000049f4f2 in pevent_event_info (s=0x7fffffffdab0,
> event=0x0, record=0x7fffffffda70)
>     at tools/lib/traceevent/event-parse.c:4183
> #1  0x000000000046cd52 in event_format__print (event=0x0,
> cpu=<optimized out>, data=<optimized out>, size=<optimized out>)
>     at util/trace-event-parse.c:182
> #2  0x000000000042d41b in process_event (event=0x7fffef9d1e60,
> sample=0x7fffffffdc90, evsel=0x90d870, machine=0x906f80,
>     al=<optimized out>) at builtin-script.c:415
> #3  0x000000000042c4e1 in process_sample_event (tool=<optimized out>,
> event=0x7fffef9d1e60, sample=0x7fffffffdc90, evsel=
>     0x90d870, machine=0x906f80) at builtin-script.c:515
> #4  0x000000000046864d in perf_session_deliver_event
> (session=<optimized out>, event=0x7fffef9d1e60, sample=0x7fffffffdc90,
>     tool=0x79d020, file_offset=<optimized out>) at util/session.c:1065
> #5  0x0000000000468c5a in flush_sample_queue (s=0x906f20,
> tool=0x79d020) at util/session.c:719
> #6  0x0000000000468d46 in process_finished_round (tool=<optimized
> out>, event=<optimized out>, session=0x906f20)
>     at util/session.c:790
> #7  0x0000000000469055 in perf_session__process_user_event
> (file_offset=541768, tool=0x79d020, event=0x7fffefa2b448,
>     session=0x906f20) at util/session.c:1129
> #8  perf_session__process_event (session=0x906f20,
> event=0x7fffefa2b448, tool=0x79d020, file_offset=541768)
>     at util/session.c:1161
> #9  0x000000000046a851 in __perf_session__process_events
> (session=0x906f20, data_offset=<optimized out>,
>     data_size=<optimized out>, file_size=2564784, tool=0x79d020) at
> util/session.c:1429
> #10 0x000000000042ebdc in __cmd_script (session=0x906f20) at
> builtin-script.c:548

  reply	other threads:[~2012-09-06  1:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 23:08 [GIT PULL 00/17] perf/core improvements and fixes Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 01/17] tools lib traceevent: Modify header to work in C++ programs Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 02/17] perf session: flush_sample_queue needs to handle errors from handlers Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 03/17] perf tool: handle errors in synthesized event functions Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 04/17] perf lock: Remove use of die and handle errors Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 05/17] perf stat: Remove use of die/exit " Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 06/17] perf help: Remove use of die " Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 07/17] perf script: Remove use of die/exit Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 08/17] perf record: " Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 09/17] perf tools: Fix x86 builds with ARCH specified on the command line Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 10/17] perf tools: Fix intlist node removal Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 11/17] perf tools: Remove the node from rblist in strlist__remove Arnaldo Carvalho de Melo
2012-09-05 23:32   ` David Ahern
2012-09-05 23:08 ` [PATCH 12/17] perf tools: remove unneeded include of network header files Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 13/17] perf header: Use evlist->nr_entries on write_event_desc() Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 14/17] perf header: Set tracepoint event name only if not set Arnaldo Carvalho de Melo
2012-09-06  0:01   ` David Ahern
2012-09-06  1:30     ` Namhyung Kim [this message]
2012-09-05 23:08 ` [PATCH 15/17] perf header: Swap pmu mapping numbers if needed Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 16/17] perf tools: Replace mempcpy with memcpy Arnaldo Carvalho de Melo
2012-09-05 23:08 ` [PATCH 17/17] perf tools: Allow user to indicate path to objdump in command line Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oblkc4zm.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox