lkml.org 
[lkml]   [2015]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V7 24/24] perf tools: adding coresight etm PMU record capabilities
From
On 19 December 2015 at 10:27, Rabin Vincent <rabin@rab.in> wrote:
> On Fri, Dec 18, 2015 at 01:59:20PM -0700, Mathieu Poirier wrote:
>> +struct auxtrace_record
>> +*auxtrace_record__init(struct perf_evlist *evlist, int *err)
>> +{
>> + struct perf_pmu *cs_etm_pmu;
>> + struct perf_evsel *evsel;
>> + bool found_etm = false;
>> +
>> + cs_etm_pmu = perf_pmu__find(CORESIGHT_ETM_PMU_NAME);
>> +
>> + if (evlist) {
>> + evlist__for_each(evlist, evsel) {
>> + if (cs_etm_pmu &&
>> + evsel->attr.type == cs_etm_pmu->type)
>> + found_etm = true;
>> + }
>> + }
>> +
>> + if (found_etm)
>> + return cs_etm_record_init(err);
>> +
>> + *err = -EINVAL;
>
> This should not set an error code when found_etm is false. Otherwise
> any attempt to uses perf record without a cs_etm event enabled errors
> out.

Yes, you're right.

Many thanks for the thorough review,
Mathieu

>
>> + return NULL;
>> +}


\
 
 \ /
  Last update: 2015-12-23 18:01    [W:0.051 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site