mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Jihong <yangjihong1@huawei.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: <peterz@infradead.org>, <mingo@redhat.com>, <acme@kernel.org>,
	<mark.rutland@arm.com>, <alexander.shishkin@linux.intel.com>,
	<jolsa@kernel.org>, <irogers@google.com>,
	<adrian.hunter@intel.com>, <anshuman.khandual@arm.com>,
	<jesussanp@google.com>, <linux-perf-users@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND v4 1/4] perf trace-event-info: Add tracepoint_id_to_name() helper
Date: Fri, 23 Jun 2023 13:27:12 +0800	[thread overview]
Message-ID: <f1a428a5-add2-1c1e-df32-78ee4a1cbe7c@huawei.com> (raw)
In-Reply-To: <CAM9d7cjyVgJiVT4Lf+qGd+d2es6NcoN3H42onpN_t4Ed0JHgig@mail.gmail.com>

Hello,

On 2023/6/21 6:35, Namhyung Kim wrote:
> Hello,
> 
> On Mon, Jun 12, 2023 at 8:41 PM Yang Jihong <yangjihong1@huawei.com> wrote:
>>
>> Add tracepoint_id_to_name() helper to search for the trace events directory
>> by given event id and return the corresponding tracepoint.
>>
>> Signed-off-by: Yang Jihong <yangjihong1@huawei.com>
>> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>   tools/perf/util/trace-event-info.c | 11 +++++++++++
>>   tools/perf/util/trace-event.h      |  6 ++++++
>>   2 files changed, 17 insertions(+)
>>
>> diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
>> index c24b3a15e319..a7901f4a6654 100644
>> --- a/tools/perf/util/trace-event-info.c
>> +++ b/tools/perf/util/trace-event-info.c
>> @@ -466,6 +466,17 @@ static struct tracepoint_path *tracepoint_id_to_path(u64 config)
>>          return NULL;
>>   }
>>
>> +char *tracepoint_id_to_name(u64 config)
>> +{
>> +       struct tracepoint_path *path = tracepoint_id_to_path(config);
>> +       char *buf = NULL;
>> +
>> +       if (path && asprintf(&buf, "%s:%s", path->system, path->name) > 0)
>> +               return buf;
> 
> I think we need to call put_tracepoints_path() before return.

Yes, here need to free tracepoints path, will fix in next version.

Thanks,
Yang

  reply	other threads:[~2023-06-23  5:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  3:39 [PATCH RESEND v4 0/4] perf tools: Add printing perf_event_attr `config` and `id` symbol in perf_event_attr__fprintf() Yang Jihong
2023-06-13  3:39 ` [PATCH RESEND v4 1/4] perf trace-event-info: Add tracepoint_id_to_name() helper Yang Jihong
2023-06-20 22:35   ` Namhyung Kim
2023-06-23  5:27     ` Yang Jihong [this message]
2023-06-13  3:39 ` [PATCH RESEND v4 2/4] perf tools: Extend PRINT_ATTRf to support printing of members with a value of 0 Yang Jihong
2023-06-13  3:39 ` [PATCH RESEND v4 3/4] perf tools: Add printing perf_event_attr type symbol in perf_event_attr__fprintf() Yang Jihong
2023-06-13  3:39 ` [PATCH RESEND v4 4/4] perf tools: Add printing perf_event_attr config " Yang Jihong

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=f1a428a5-add2-1c1e-df32-78ee4a1cbe7c@huawei.com \
    --to=yangjihong1@huawei.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=irogers@google.com \
    --cc=jesussanp@google.com \
    --cc=jolsa@kernel.org \
    --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

all inboxes | Powered by JetHome®