Skip to contentSkip to conversation

perf jevents: Silence warning for ArchStd files

PATCH Applied Ian Rogers 3 participants 5 messages May 6, 2021 – May 8, 2021 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 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
index ed4f0bd72e5a..7422b0ea8790 100644
@@ -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
#1 lore raw
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.

---
  tools/perf/pmu-events/jevents.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/pmu-events/jevents.c +0 -0
index ed4f0bd72e5a..7422b0ea8790 100644

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;
  	}
 
author reviewer
#2 lore raw
Quoted 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.

---
  tools/perf/pmu-events/jevents.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/pmu-events/jevents.c +0 -0
index ed4f0bd72e5a..7422b0ea8790 100644

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.

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,
John

Quoted 6 lines
tools/perf/pmu-events/jevents.c +2 -0
+             else
+                     pr_info("%s: Ignoring file %s\n", prog, fpath);
              return 0;
      }
 
Reviewed-by
#3 lore raw
Quoted 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.

---
   tools/perf/pmu-events/jevents.c | 6 ++++--
   1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/pmu-events/jevents.c +0 -0
index ed4f0bd72e5a..7422b0ea8790 100644

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.

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_debug is 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.

maintainer Applied
#4 lore raw

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.

---
   tools/perf/pmu-events/jevents.c | 6 ++++--
   1 file changed, 4 insertions(+), 2 deletions(-)
tools/perf/pmu-events/jevents.c +0 -0
index ed4f0bd72e5a..7422b0ea8790 100644

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.

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_debug is 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.

Thanks, applied.

- Arnaldo