From: David Ahern <daahern@cisco.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH 09/10] perf script: Add support for dumping symbols
Date: Wed, 09 Mar 2011 17:21:59 -0700 [thread overview]
Message-ID: <4D7819A7.2000409@cisco.com> (raw)
In-Reply-To: <20110309233039.GA2533@nowhere>
On 03/09/11 16:30, Frederic Weisbecker wrote:
> On Wed, Mar 09, 2011 at 03:31:30PM -0300, Arnaldo Carvalho de Melo wrote:
>> @@ -868,6 +892,8 @@ int cmd_script(int argc, const char **argv, const char *prefix __used)
>> exit(-1);
>> }
>>
>> + symbol_conf.use_callchain = no_callchain ? false : true;
>> +
>
> That also depend on (sample_type & PERF_SAMPLE_CALLCHAIN)...
>
>> if (rec_script_path)
>> script_path = rec_script_path;
>> if (rep_script_path)
>> diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
>> index f642615..51fac44 100644
>> --- a/tools/perf/util/session.c
>> +++ b/tools/perf/util/session.c
>> @@ -1145,3 +1145,64 @@ size_t perf_session__fprintf_nr_events(struct perf_session *session, FILE *fp)
>>
>> return ret;
>> }
>> +
>> +void perf_session__print_symbols(union perf_event *event,
>> + struct perf_sample *sample,
>> + struct perf_session *session)
>> +{
>> + struct addr_location al;
>> + const char *symname, *dsoname;
>> + struct callchain_cursor *cursor = &session->callchain_cursor;
>> + struct callchain_cursor_node *node;
>> +
>> + if (perf_event__preprocess_sample(event, session, &al, sample,
>> + NULL) < 0) {
>> + error("problem processing %d event, skipping it.\n",
>> + event->header.type);
>> + return;
>> + }
>> +
>> + if (symbol_conf.use_callchain && sample->callchain) {
>
> ...otherwise you may deref some crap there. sample->callchain is
> random when there is actually no callchain.
Doh. I'll add a check to perf_session__check_attr for
PERF_SAMPLE_CALLCHAIN and reset use_callchain if necessary.
David
next prev parent reply other threads:[~2011-03-10 0:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-09 18:31 [GIT PULL 00/10] perf/core fixes and improvements Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 01/10] perf session: Simplify evlist creation from perf.data header Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 02/10] perf evsel: Assume rest of perf_header_attr functions Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 03/10] perf header: Stop using 'self' Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 04/10] perf top: Fix events overflow in top command Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 05/10] perf top: Don't let events to eat up whole header line Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 06/10] perf script: Change process_event prototype Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 07/10] perf script: Move printing of 'common' data from print_event and rename Arnaldo Carvalho de Melo
2011-03-09 23:50 ` Frederic Weisbecker
2011-03-10 0:04 ` David Ahern
2011-03-10 0:10 ` Frederic Weisbecker
2011-03-10 0:11 ` David Ahern
2011-03-10 0:14 ` Frederic Weisbecker
2011-03-10 0:22 ` Frederic Weisbecker
2011-03-10 0:32 ` David Ahern
2011-03-10 0:50 ` Frederic Weisbecker
2011-03-09 18:31 ` [PATCH 08/10] perf script: Support custom field selection for output Arnaldo Carvalho de Melo
2011-03-09 18:31 ` [PATCH 09/10] perf script: Add support for dumping symbols Arnaldo Carvalho de Melo
2011-03-09 23:30 ` Frederic Weisbecker
2011-03-10 0:21 ` David Ahern [this message]
2011-03-09 18:31 ` [PATCH 10/10] perf script: Add support for H/W and S/W events 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=4D7819A7.2000409@cisco.com \
--to=daahern@cisco.com \
--cc=acme@ghostprotocols.net \
--cc=acme@redhat.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.