linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Jihong <yangjihong1@huawei.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: <peterz@infradead.org>, <mingo@redhat.com>,
	<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
	<jolsa@redhat.com>, <namhyung@kernel.org>,
	<linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] perf annotate: Add itrace options support
Date: Tue, 15 Jun 2021 11:18:05 +0800	[thread overview]
Message-ID: <d957a6c1-8fa3-e143-3d81-d16e9f45ed5d@huawei.com> (raw)
In-Reply-To: <YMOG04alB0OoBEKz@kernel.org>

Hell Arnaldo,

On 2021/6/11 23:52, Arnaldo Carvalho de Melo wrote:
> Em Mon, Jun 07, 2021 at 10:59:18AM +0800, Yang Jihong escreveu:
>> The "auxtrace_info" and "auxtrace" functions are not set in "tool" member of
>> "annotate". As a result, perf annotate does not support parsing itrace data.
>>
>> A simple example is as follows:
>>
>>    # perf record -e arm_spe_0/branch_filter=1/ -a sleep 1
>>    [ perf record: Woken up 9 times to write data ]
>>    [ perf record: Captured and wrote 20.874 MB perf.data ]
>>    # perf annotate --stdio
>>    Error:
>>    The perf.data data has no samples!
>>
>> Solution:
>> 1.Add itrace options in help,
>> 2.Set hook functions of "auxtrace_info" and "auxtrace" in perf_tool.
> 
> So, while we wait for someone to ack/review this, please send a v2
> updating tools/perf/Documentation/perf-annotate.txt to have references
> to these new 'perf annotate' options.
> 
> It all looks ok, so if nobody chimes in, I'll process v2 on my own.

OK, I have submitted the v3 patch, which updates 
tools/perf/Documentation/perf-annotate.txt:
https://lore.kernel.org/patchwork/patch/1446618/

Please take time to review the new patch. :)

Thanks,
Yang
> 
> Thanks,
> 
> - Arnaldo
>   
>> Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
>> ---
>>
>> Changes since v1:
>>   - Adjust spaces to maintain alignment in "tool".
>>
>>   tools/perf/builtin-annotate.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
>> index 49627a7bed7c..8f87658eff31 100644
>> --- a/tools/perf/builtin-annotate.c
>> +++ b/tools/perf/builtin-annotate.c
>> @@ -474,6 +474,8 @@ int cmd_annotate(int argc, const char **argv)
>>   			.attr	= perf_event__process_attr,
>>   			.build_id = perf_event__process_build_id,
>>   			.tracing_data   = perf_event__process_tracing_data,
>> +			.auxtrace_info	= perf_event__process_auxtrace_info,
>> +			.auxtrace	= perf_event__process_auxtrace,
>>   			.feature	= process_feature_event,
>>   			.ordered_events = true,
>>   			.ordering_requires_timestamps = true,
>> @@ -483,6 +485,9 @@ int cmd_annotate(int argc, const char **argv)
>>   	struct perf_data data = {
>>   		.mode  = PERF_DATA_MODE_READ,
>>   	};
>> +	struct itrace_synth_opts itrace_synth_opts = {
>> +		.set = 0,
>> +	};
>>   	struct option options[] = {
>>   	OPT_STRING('i', "input", &input_name, "file",
>>   		    "input file name"),
>> @@ -547,6 +552,9 @@ int cmd_annotate(int argc, const char **argv)
>>   	OPT_CALLBACK(0, "percent-type", &annotate.opts, "local-period",
>>   		     "Set percent type local/global-period/hits",
>>   		     annotate_parse_percent_type),
>> +	OPT_CALLBACK_OPTARG(0, "itrace", &itrace_synth_opts, NULL, "opts",
>> +			    "Instruction Tracing options\n" ITRACE_HELP,
>> +			    itrace_parse_synth_opts),
>>   
>>   	OPT_END()
>>   	};
>> @@ -591,6 +599,8 @@ int cmd_annotate(int argc, const char **argv)
>>   	if (IS_ERR(annotate.session))
>>   		return PTR_ERR(annotate.session);
>>   
>> +	annotate.session->itrace_synth_opts = &itrace_synth_opts;
>> +
>>   	annotate.has_br_stack = perf_header__has_feat(&annotate.session->header,
>>   						      HEADER_BRANCH_STACK);
>>   
>> -- 
>> 2.30.GIT
>>
> 

      reply	other threads:[~2021-06-15  3:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07  2:59 [PATCH v2] perf annotate: Add itrace options support Yang Jihong
2021-06-08 17:10 ` Arnaldo Carvalho de Melo
2021-06-10  2:02   ` Yang Jihong
2021-06-11 15:52 ` Arnaldo Carvalho de Melo
2021-06-15  3:18   ` Yang Jihong [this message]

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=d957a6c1-8fa3-e143-3d81-d16e9f45ed5d@huawei.com \
    --to=yangjihong1@huawei.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).