lkml.org 
[lkml]   [2019]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 5/5] perf record: Put a copy of kcore into the perf.data directory
From
Date
On 7/10/19 2:20 PM, Jiri Olsa wrote:
> On Fri, Oct 04, 2019 at 11:31:21AM +0300, Adrian Hunter wrote:
>
> SNIP
>
>> +}
>> +
>> static int record__mmap_evlist(struct record *rec,
>> struct evlist *evlist)
>> {
>> @@ -1383,6 +1417,12 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
>> session->header.env.comp_type = PERF_COMP_ZSTD;
>> session->header.env.comp_level = rec->opts.comp_level;
>>
>> + if (rec->opts.kcore &&
>> + !record__kcore_readable(&session->machines.host)) {
>> + pr_err("ERROR: kcore is not readable.\n");
>> + return -1;
>> + }
>> +
>
> is there any reason why this change is not merged with the change below?

It seemed better to do the validation before opening all the events.

>
>
>> record__init_features(rec);
>>
>> if (rec->opts.use_clockid && rec->opts.clockid_res_ns)
>> @@ -1414,6 +1454,14 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
>> }
>> session->header.env.comp_mmap_len = session->evlist->core.mmap_len;
>>
>> + if (rec->opts.kcore) {
>> + err = record__kcore_copy(&session->machines.host, data);
>> + if (err) {
>> + pr_err("ERROR: Failed to copy kcore\n");
>> + goto out_child;
>> + }
>> + }
>> +
>
> thanks,
> jirka
>

\
 
 \ /
  Last update: 2019-10-07 14:08    [W:0.094 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site