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] [thread-next>] [day] [month] [year] [list]
Message-ID: <b4e6f20c-9845-4114-8f48-ef1f46869a09@linux.intel.com>
Date:   Thu, 7 Dec 2023 09:42:01 -0500
From:   "Liang, Kan" <kan.liang@...ux.intel.com>
To:     Ian Rogers <irogers@...gle.com>
Cc:     acme@...nel.org, peterz@...radead.org, mingo@...hat.com,
        namhyung@...nel.org, jolsa@...nel.org, adrian.hunter@...el.com,
        john.g.garry@...cle.com, will@...nel.org, james.clark@....com,
        mike.leach@...aro.org, leo.yan@...aro.org,
        yuhaixin.yhx@...ux.alibaba.com, renyu.zj@...ux.alibaba.com,
        tmricht@...ux.ibm.com, ravi.bangoria@....com,
        linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 2/6] perf mem: Clean up perf_mem_events__ptr()



On 2023-12-06 4:04 p.m., Ian Rogers wrote:
>>                  * The load and store operations are required, use the event
>>                  * PERF_MEM_EVENTS__LOAD_STORE if it is supported.
>> @@ -3289,15 +3303,15 @@ static int perf_c2c__record(int argc, const char **argv)
>>                         e->record = true;
>>                         rec_argv[i++] = "-W";
>>                 } else {
>> -                       e = perf_mem_events__ptr(PERF_MEM_EVENTS__LOAD);
>> +                       e = perf_mem_events__ptr(pmu, PERF_MEM_EVENTS__LOAD);
> Fwiw, it seems strange in cases like this that the function isn't:
> perf_pmu__mem_events_ptr(pmu, PERF_MEM_EVENTS__LOAD)

Not just this one. The PMU is also added into other functions.
I will change the name for all of them in V2.

diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
index 8c5694b2d0b0..0ad301a2e424 100644
--- a/tools/perf/util/mem-events.h
+++ b/tools/perf/util/mem-events.h
@@ -36,14 +36,15 @@ enum {
 extern unsigned int perf_mem_events__loads_ldlat;
 extern struct perf_mem_event perf_mem_events[PERF_MEM_EVENTS__MAX];

-int perf_mem_events__parse(const char *str);
-int perf_mem_events__init(void);
+int perf_pmu__mem_events_parse(struct perf_pmu *pmu, const char *str);
+int perf_pmu__mem_events_init(struct perf_pmu *pmu);

 const char *perf_mem_events__name(int i, const char *pmu_name);
-struct perf_mem_event *perf_mem_events__ptr(int i);
+struct perf_mem_event *perf_pmu__mem_events_ptr(struct perf_pmu *pmu,
int i);
+struct perf_pmu *perf_mem_events_find_pmu(void);
 bool is_mem_loads_aux_event(struct evsel *leader);

-void perf_mem_events__list(void);
+void perf_pmu__mem_events_list(struct perf_pmu *pmu);
 int perf_mem_events__record_args(const char **rec_argv, int *argv_nr,
                                 char **rec_tmp, int *tmp_nr);

Thanks,
Kan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ