lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f1a428a5-add2-1c1e-df32-78ee4a1cbe7c@huawei.com>
Date:   Fri, 23 Jun 2023 13:27:12 +0800
From:   Yang Jihong <yangjihong1@...wei.com>
To:     Namhyung Kim <namhyung@...nel.org>
CC:     <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
        <mark.rutland@....com>, <alexander.shishkin@...ux.intel.com>,
        <jolsa@...nel.org>, <irogers@...gle.com>,
        <adrian.hunter@...el.com>, <anshuman.khandual@....com>,
        <jesussanp@...gle.com>, <linux-perf-users@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND v4 1/4] perf trace-event-info: Add
 tracepoint_id_to_name() helper

Hello,

On 2023/6/21 6:35, Namhyung Kim wrote:
> Hello,
> 
> On Mon, Jun 12, 2023 at 8:41 PM Yang Jihong <yangjihong1@...wei.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@...wei.com>
>> Acked-by: Adrian Hunter <adrian.hunter@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ