Skip to content

Commit 4d5564b

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit 4d5564b

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

tools/perf/arch/powerpc/util/auxtrace.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
7070
struct evsel *pos;
7171
int found = 0;
7272

73+
/*
74+
* Set err value to zero here. Any fail later
75+
* will set appropriate return code to err.
76+
*/
77+
*err = 0;
78+
7379
evlist__for_each_entry(evlist, pos) {
7480
if (strstarts(pos->name, "vpa_dtl")) {
7581
found = 1;

tools/perf/builtin-record.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,7 @@ static int record__auxtrace_init(struct record *rec)
865865
}
866866

867867
if (!rec->itr) {
868+
err = -EINVAL;
868869
rec->itr = auxtrace_record__init(rec->evlist, &err);
869870
if (err)
870871
return err;

tools/perf/util/auxtrace.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,23 @@ int auxtrace_parse_aux_action(struct evlist *evlist)
896896
return 0;
897897
}
898898

899+
/**
900+
* auxtrace_record__init - Initialize an AUX area tracing record.
901+
* @evlist: The list of events to check for AUX area tracing event.
902+
* @err: Pointer to an integer to store return code.
903+
*
904+
* This function looks through the @evlist to determine which AUX area
905+
* tracing hardware is being used and initializes the auxtrace_record
906+
* structure.
907+
*
908+
* Return:
909+
* a) A pointer to the struct auxtrace_record on success.
910+
* b) NULL with @err = 0 if no AUX area tracing event is found/supported
911+
* (not considered an error).
912+
* c) NULL with non-zero @err on actual auxtrace_record__init failure.
913+
*/
899914
struct auxtrace_record *__weak
900-
auxtrace_record__init(struct evlist *evlist __maybe_unused, int *err)
915+
auxtrace_record__init(struct evlist __maybe_unused *evlist, int *err)
901916
{
902917
*err = 0;
903918
return NULL;

0 commit comments

Comments
 (0)