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: <ef39150e-902d-4c58-bc9e-efa08ef5447b@amd.com>
Date: Wed, 18 Sep 2024 14:22:53 +0530
From: "Sapkal, Swapnil" <swapnil.sapkal@....com>
To: James Clark <james.clark@...aro.org>, Ravi Bangoria
	<ravi.bangoria@....com>
CC: <yu.c.chen@...el.com>, <mark.rutland@....com>,
	<alexander.shishkin@...ux.intel.com>, <jolsa@...nel.org>,
	<rostedt@...dmis.org>, <vincent.guittot@...aro.org>, <bristot@...hat.com>,
	<adrian.hunter@...el.com>, <james.clark@....com>,
	<kan.liang@...ux.intel.com>, <gautham.shenoy@....com>,
	<kprateek.nayak@....com>, <juri.lelli@...hat.com>,
	<yangjihong@...edance.com>, <void@...ifault.com>, <tj@...nel.org>,
	<linux-kernel@...r.kernel.org>, <linux-perf-users@...r.kernel.org>,
	<santosh.shukla@....com>, <ananth.narayan@....com>, <sandipan.das@....com>,
	<peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
	<namhyung@...nel.org>, <irogers@...gle.com>
Subject: Re: [PATCH 2/5] perf sched stats: Add record and rawdump support

Hi James,

Thanks for the review.

On 9/17/2024 4:05 PM, James Clark wrote:
> 
> 
> On 16/09/2024 17:47, Ravi Bangoria wrote:
>> From: Swapnil Sapkal <swapnil.sapkal@....com>
>>
>> Define new, perf tool only, sample types and their layouts. Add logic
>> to parse /proc/schedstat, convert it to perf sample format and save
>> samples to perf.data file with `perf sched stats record` command. Also
>> add logic to read perf.data file, interpret schedstat samples and
>> print rawdump of samples with `perf script -D`.
>>
>> Note that, /proc/schedstat file output is standardized with version
>> number. The patch supports v15 but older or newer version can be added
>> easily.
>>
>> Signed-off-by: Swapnil Sapkal <swapnil.sapkal@....com>
>> Co-developed-by: Ravi Bangoria <ravi.bangoria@....com>
>> Signed-off-by: Ravi Bangoria <ravi.bangoria@....com>
>> ---
> 
> [...]
> 
>> +int perf_event__synthesize_schedstat(const struct perf_tool *tool,
>> +                     perf_event__handler_t process,
>> +                     struct perf_cpu_map *user_requested_cpus)
>> +{
>> +    union perf_event *event = NULL;
>> +    size_t line_len = 0;
>> +    char *line = NULL;
>> +    char bf[BUFSIZ];
>> +    __u64 timestamp;
>> +    __u16 version;
>> +    struct io io;
>> +    int ret = -1;
>> +    int cpu = -1;
>> +    char ch;
>> +
>> +    io.fd = open("/proc/schedstat", O_RDONLY, 0);
> 
> Other parts of the tool use procfs__mountpoint() for /proc. Although it 
> can only be in one place so it doesn't actually make a difference for 
> this one. Probably worth it for consistency though.
> 
Sure, I will update this in the next version.

>> +    if (io.fd < 0) {
>> +        pr_err("Failed to open /proc/schedstat\n");
> 
> A hint about CONFIG_SCHEDSTAT would be useful here.

Sure, I will update.

--
Thanks and Regards,
Swapnil

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ