perf jevents: Silence warning for ArchStd files
Ian Rogers
reviewerPATCH 1/1 perf jevents: Silence warning for ArchStd files
json files in the level 1 directory are used for ArchStd events (see preprocess_arch_std_files), as such they shouldn't be warned about.
--- tools/perf/pmu-events/jevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/pmu-events/jevents.c +4 -2
@@ -1123,8 +1123,10 @@ static int process_one_file(const char *fpath, const struct stat *sb, mapfile =strdup (fpath);return 0 ; } - -pr_info ("%s: Ignoring file %s\n" , prog, fpath); +if (is_json_file (bname)) +pr_debug ("%s: ArchStd json is preprocessed %s\n" , prog, fpath); +else +pr_info ("%s: Ignoring file %s\n" , prog, fpath);return 0 ; }
Signature · 1 line
2.31.1.607.g51e8a6a459-goog
Quoted 13 lines · Ian Rogers
json files in the level 1 directory are used for ArchStd events (see
preprocess_arch_std_files), as such they shouldn't be warned about.Signed-off-by Ian Rogers <[email protected]>--- tools/perf/pmu-events/jevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tools/perf/pmu-events/jevents.c +0
-0
tools/perf/pmu-events/jevents.c static int process_one_file(const char *fpath, const struct stat *sb, · line 1127
Quoted 7 lines
tools/perf/pmu-events/jevents.c +2
-2@@ -1123,8 +1123,10 @@ static int process_one_file(const char *fpath, const struct stat *sb, mapfile =strdup (fpath);return 0 ; } - -pr_info ("%s: Ignoring file %s\n" , prog, fpath); +if (is_json_file (bname)) +pr_debug ("%s: ArchStd json is preprocessed %s\n" , prog, fpath)
We could get more elaborate and add the same first debug print in process_one_file() to preprocess_arch_std_file() to give the allusion that they are preprocessed, and change the logic not print that for arch std files (in process_one_file()). But not sure it's worth it.
Or else we could also just omit any print here for archstd files here.
But I suppose what you are doing is ok...
Thanks,
John
Quoted 6 lines
tools/perf/pmu-events/jevents.c +2
-0+else +pr_info ("%s: Ignoring file %s\n" , prog, fpath);return 0 ; }
Ian Rogers
reviewerQuoted 27 lines · John Garry
Quoted 13 lines · Ian Rogers
json files in the level 1 directory are used for ArchStd events (see
preprocess_arch_std_files), as such they shouldn't be warned about.Signed-off-by Ian Rogers <[email protected]>--- tools/perf/pmu-events/jevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tools/perf/pmu-events/jevents.c +0
-0tools/perf/pmu-events/jevents.c static int process_one_file(const char *fpath, const struct stat *sb, · line 1127
Quoted 7 lines
tools/perf/pmu-events/jevents.c +2
-2@@ -1123,8 +1123,10 @@ static int process_one_file(const char *fpath, const struct stat *sb, mapfile =strdup (fpath);return 0 ; } - -pr_info ("%s: Ignoring file %s\n" , prog, fpath); +if (is_json_file (bname)) +pr_debug ("%s: ArchStd json is preprocessed %s\n" , prog, fpath)We could get more elaborate and add the same first debug print in
process_one_file()topreprocess_arch_std_file()to give the allusion that they are preprocessed, and change the logic not print that for arch std files (inprocess_one_file()). But not sure it's worth it.
Quoted 1 line
Or else we could also just omit any print here for archstd files here.
I thought about just dropping the print in the json case but then a comment would be nice, the pr_debug is a comment and is somewhat intention revealing. If you think it is overkill then it is ok to change.
Thanks,
Ian
Quoted 12 lines
But I suppose what you are doing is ok...
Thanks,
JohnQuoted 6 lines
tools/perf/pmu-events/jevents.c +2
-0+else +pr_info ("%s: Ignoring file %s\n" , prog, fpath);return 0 ; }
John Garry
Reviewed-byQuoted 27 lines · Ian Rogers
Quoted 26 lines · John Garry
Quoted 13 lines · Ian Rogers
json files in the level 1 directory are used for ArchStd events (see
preprocess_arch_std_files), as such they shouldn't be warned about.Signed-off-by Ian Rogers<[email protected]>--- tools/perf/pmu-events/jevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tools/perf/pmu-events/jevents.c +0
-0tools/perf/pmu-events/jevents.c static int process_one_file(const char *fpath, const struct stat *sb, · line 1127
Quoted 7 lines
tools/perf/pmu-events/jevents.c +2
-2@@ -1123,8 +1123,10 @@ static int process_one_file(const char *fpath, const struct stat *sb, mapfile =strdup (fpath);return 0 ; } - -pr_info ("%s: Ignoring file %s\n" , prog, fpath); +if (is_json_file (bname)) +pr_debug ("%s: ArchStd json is preprocessed %s\n" , prog, fpath)We could get more elaborate and add the same first debug print in
process_one_file()topreprocess_arch_std_file()to give the allusion that they are preprocessed, and change the logic not print that for arch std files (inprocess_one_file()). But not sure it's worth it.
Quoted 5 lines
Quoted 1 line
Or else we could also just omit any print here for archstd files here.
I thought about just dropping the print in the json case but then a comment would be nice, the
pr_debugis a comment and is somewhat intention revealing. If you think it is overkill then it is ok to change.
I don't think it's a big deal either way.
Em Fri, May 07, 2021 at 05:29:06PM +0100, John Garry escreveu:
Quoted 29 lines · Ian Rogers
Quoted 28 lines · John Garry
Quoted 27 lines · Ian Rogers
Quoted 13 lines
json files in the level 1 directory are used for ArchStd events (see
preprocess_arch_std_files), as such they shouldn't be warned about.Signed-off-by Ian Rogers<[email protected]>--- tools/perf/pmu-events/jevents.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tools/perf/pmu-events/jevents.c +0
-0tools/perf/pmu-events/jevents.c static int process_one_file(const char *fpath, const struct stat *sb, · line 1127
Quoted 7 lines
tools/perf/pmu-events/jevents.c +2
-2@@ -1123,8 +1123,10 @@ static int process_one_file(const char *fpath, const struct stat *sb, mapfile =strdup (fpath);return 0 ; } - -pr_info ("%s: Ignoring file %s\n" , prog, fpath); +if (is_json_file (bname)) +pr_debug ("%s: ArchStd json is preprocessed %s\n" , prog, fpath)We could get more elaborate and add the same first debug print in
process_one_file()topreprocess_arch_std_file()to give the allusion that they are preprocessed, and change the logic not print that for arch std files (inprocess_one_file()). But not sure it's worth it.Or else we could also just omit any print here for archstd files here.
Quoted 8 lines
Quoted 4 lines
I thought about just dropping the print in the json case but then a comment would be nice, the
pr_debugis a comment and is somewhat intention revealing. If you think it is overkill then it is ok to change.I don't think it's a big deal either way.
Reviewed-by John Garry <[email protected]>
Thanks, applied.
- Arnaldo