Skip to contentSkip to conversation

perf parse-events: Remove unused header files

PATCH Applied Ian Rogers 3 participants 11 messages Sep 11, 2023 – Sep 12, 2023

Subsystems (2)
lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/5 perf parse-events: Remove unused header files

The fnmatch header is now used in the PMU matching logic in pmu.c.

---
 tools/perf/util/parse-events.y | 3 ---
 1 file changed, 3 deletions(-)
tools/perf/util/parse-events.y +0 -3
index 21bfe7e0d944..ef03728b7ea3 100644
@@ -9,11 +9,8 @@
 #define YYDEBUG 1
 
 #include <errno.h>
-#include <fnmatch.h>
-#include <stdio.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
-#include <linux/zalloc.h>
 #include "pmu.h"
 #include "pmus.h"
 #include "evsel.h"
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
author reviewer
#1 lore raw

PATCH 2/5 perf parse-events: Make YYDEBUG dependent on doing a debug build

YYDEBUG enables line numbers and other error helpers in the generated parse-events-bison.c. These shouldn't be generated when debugging isn't enabled.

---
 tools/perf/util/parse-events.y | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/parse-events.y +2 -0
index ef03728b7ea3..786393106ae6 100644
@@ -6,7 +6,9 @@
 
 %{
 
+#ifndef NDEBUG
 #define YYDEBUG 1
+#endif
 
 #include <errno.h>
 #include <linux/compiler.h>
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
maintainer Acked-by on v1 2/5
#2 lore raw

Re: [PATCH v1 2/5] perf parse-events: Make YYDEBUG dependent on doing a debug build

Quoted 6 lines · Ian Rogers

YYDEBUG enables line numbers and other error helpers in the generated parse-events-bison.c. These shouldn't be generated when debugging isn't enabled.

Thanks,
Namhyung

Quoted 21 lines
---
 tools/perf/util/parse-events.y | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/parse-events.y +2 -1
index ef03728b7ea3..786393106ae6 100644
@@ -6,7 +6,9 @@
 
 %{
 
+#ifndef NDEBUG
 #define YYDEBUG 1
+#endif
 
 #include <errno.h>
 #include <linux/compiler.h>
--

2.42.0.283.g2d96d420d3-goog

author reviewer
#3 lore raw

PATCH 3/5 perf expr: Make YYDEBUG dependent on doing a debug build

In reply to Ian Rogers

YYDEBUG enables line numbers and other error helpers in the generated expr-bison.c. These shouldn't be generated when debugging isn't enabled.

---
 tools/perf/util/expr.y | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/expr.y +2 -0
index 6c93b358cc2d..e364790babb5 100644
@@ -1,6 +1,8 @@
 /* Simple expression parser */
 %{
+#ifndef NDEBUG
 #define YYDEBUG 1
+#endif
 #include <assert.h>
 #include <math.h>
 #include <stdlib.h>
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
maintainer Acked-by on v1 3/5
#4 lore raw

Re: [PATCH v1 3/5] perf expr: Make YYDEBUG dependent on doing a debug build

Quoted 6 lines · Ian Rogers

YYDEBUG enables line numbers and other error helpers in the generated expr-bison.c. These shouldn't be generated when debugging isn't enabled.

Thanks,
Namhyung

Quoted 20 lines
---
 tools/perf/util/expr.y | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/util/expr.y +2 -1
index 6c93b358cc2d..e364790babb5 100644
@@ -1,6 +1,8 @@
 /* Simple expression parser */
 %{
+#ifndef NDEBUG
 #define YYDEBUG 1
+#endif
 #include <assert.h>
 #include <math.h>
 #include <stdlib.h>
--

2.42.0.283.g2d96d420d3-goog

author reviewer
#5 lore raw

PATCH 4/5 perf pmu: Add YYDEBUG

In reply to Ian Rogers

YYDEBUG enables line numbers and other error helpers in the generated pmu-bison.c. Conditionally enabled only for debug builds.

---
 tools/perf/util/pmu.y | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/util/pmu.y +4 -0
index 600c8c158c8e..198907a8a48a 100644
@@ -5,6 +5,10 @@
 
 %{
 
+#ifndef NDEBUG
+#define YYDEBUG 1
+#endif
+
 #include <linux/compiler.h>
 #include <linux/list.h>
 #include <linux/bitmap.h>
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
maintainer Acked-by on v1 4/5
#6 lore raw

Re: [PATCH v1 4/5] perf pmu: Add YYDEBUG

Quoted 5 lines · Ian Rogers

YYDEBUG enables line numbers and other error helpers in the generated pmu-bison.c. Conditionally enabled only for debug builds.

Thanks,
Namhyung

Quoted 22 lines
---
 tools/perf/util/pmu.y | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/util/pmu.y +4 -1
index 600c8c158c8e..198907a8a48a 100644
@@ -5,6 +5,10 @@
 
 %{
 
+#ifndef NDEBUG
+#define YYDEBUG 1
+#endif
+
 #include <linux/compiler.h>
 #include <linux/list.h>
 #include <linux/bitmap.h>
--

2.42.0.283.g2d96d420d3-goog

author reviewer
#7 lore raw

PATCH 5/5 perf bpf-filter: Add YYDEBUG

In reply to Ian Rogers

YYDEBUG enables line numbers and other error helpers in the generated bpf-filter-bison.c. Conditionally enabled only for debug builds.

---
 tools/perf/util/bpf-filter.y | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/util/bpf-filter.y +4 -0
index 5dfa948fc986..0e4d6de3c2ad 100644
@@ -3,6 +3,10 @@
 
 %{
 
+#ifndef NDEBUG
+#define YYDEBUG 1
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <linux/compiler.h>
Signature · 1 line
2.42.0.283.g2d96d420d3-goog
maintainer Acked-by on v1 5/5
#8 lore raw

Re: [PATCH v1 5/5] perf bpf-filter: Add YYDEBUG

Quoted 5 lines · Ian Rogers

YYDEBUG enables line numbers and other error helpers in the generated bpf-filter-bison.c. Conditionally enabled only for debug builds.

Thanks,
Namhyung

Quoted 22 lines
---
 tools/perf/util/bpf-filter.y | 4 ++++
 1 file changed, 4 insertions(+)
tools/perf/util/bpf-filter.y +4 -1
index 5dfa948fc986..0e4d6de3c2ad 100644
@@ -3,6 +3,10 @@
 
 %{
 
+#ifndef NDEBUG
+#define YYDEBUG 1
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <linux/compiler.h>
--

2.42.0.283.g2d96d420d3-goog

maintainer Acked-by on v1 1/5
#9 lore raw
In reply to Ian Rogers
Quoted 4 lines · Ian Rogers

The fnmatch header is now used in the PMU matching logic in pmu.c.

Thanks,
Namhyung

Quoted 23 lines
---
 tools/perf/util/parse-events.y | 3 ---
 1 file changed, 3 deletions(-)
tools/perf/util/parse-events.y +0 -4
index 21bfe7e0d944..ef03728b7ea3 100644
@@ -9,11 +9,8 @@
 #define YYDEBUG 1
 
 #include <errno.h>
-#include <fnmatch.h>
-#include <stdio.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
-#include <linux/zalloc.h>
 #include "pmu.h"
 #include "pmus.h"
 #include "evsel.h"
--

2.42.0.283.g2d96d420d3-goog

maintainer Applied
#10 lore raw

Em Mon, Sep 11, 2023 at 10:58:18PM -0700, Namhyung Kim escreveu:

Quoted 7 lines · Ian Rogers
Quoted 4 lines

The fnmatch header is now used in the PMU matching logic in pmu.c.

Thanks, applied the series.

- Arnaldo

Quoted 26 lines

Thanks,
Namhyung

Quoted 23 lines
---
 tools/perf/util/parse-events.y | 3 ---
 1 file changed, 3 deletions(-)
tools/perf/util/parse-events.y +0 -4
index 21bfe7e0d944..ef03728b7ea3 100644
@@ -9,11 +9,8 @@
 #define YYDEBUG 1
 
 #include <errno.h>
-#include <fnmatch.h>
-#include <stdio.h>
 #include <linux/compiler.h>
 #include <linux/types.h>
-#include <linux/zalloc.h>
 #include "pmu.h"
 #include "pmus.h"
 #include "evsel.h"
--

2.42.0.283.g2d96d420d3-goog

Signature · 1 line
- Arnaldo