Skip to contentSkip to conversation

perf bench bpf: Add missing .gitignore file

PATCH In review Arnaldo Carvalho de Melo 3 participants 5 messages Jun 24 perf events

lore
Share & tools
lore

Arnaldo Carvalho de Melo

author maintainer
#0 lore raw

PATCH 1/1 perf bench bpf: Add missing .gitignore file

Hi Linus,

I'll have this in the next pull req if you prefer not to merge
now,

- Arnaldo

---
From: Arnaldo Carvalho de Melo <[email protected]>

In 713eeb2279402758 ("perf build: Move BPF skeleton generation out of Makefile.perf") the bpf_skel used with 'perf bench uprobe' was moved from tools/perf/util/bpf_skel/ to tools/perf/bench/bpf_skel.

Copy tools/perf/util/bpf_skel/.gitignore to that new directory so that files generated during build get ignored by git.

Cc Adrian Hunter <[email protected]>
Cc Ian Rogers <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Fixes 713eeb2279402758 ("perf build: Move BPF skeleton generation out of Makefile.perf")
---
 tools/perf/bench/bpf_skel/.gitignore | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 tools/perf/bench/bpf_skel/.gitignore
tools/perf/bench/bpf_skel/.gitignore new file +4 -0
new file mode 100644
index 0000000000000000..cd01455e1b53c3d9
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+.tmp
+*.skel.h
+vmlinux.h
Signature · 1 line
2.54.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Arnaldo Carvalho de Melo

Hi Linus,

I'll have this in the next pull req if you prefer not to merge
now,

- Arnaldo

---
From: Arnaldo Carvalho de Melo <[email protected]>

In 713eeb2279402758 ("perf build: Move BPF skeleton generation out of Makefile.perf") the bpf_skel used with 'perf bench uprobe' was moved from tools/perf/util/bpf_skel/ to tools/perf/bench/bpf_skel.

Copy tools/perf/util/bpf_skel/.gitignore to that new directory so that files generated during build get ignored by git.

Cc Adrian Hunter <[email protected]>
Cc Ian Rogers <[email protected]>
Cc James Clark <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Fixes 713eeb2279402758 ("perf build: Move BPF skeleton generation out of Makefile.perf")
---
 tools/perf/bench/bpf_skel/.gitignore | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 tools/perf/bench/bpf_skel/.gitignore
tools/perf/bench/bpf_skel/.gitignore new file +0 -0
new file mode 100644
index 0000000000000000..cd01455e1b53c3d9

tools/perf/bench/bpf_skel/.gitignore line 4

Quoted 4 lines
tools/perf/bench/bpf_skel/.gitignore new file +4 -0
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+.tmp
+*.skel.h
+vmlinux.h

I think it's enough to add '*.skel.h' only as other files are still under util/bpf_skel. But having others would not be harmful.

Thanks,
Namhyung

author maintainer
#2 lore raw
Quoted 11 lines · Namhyung Kim

tools/perf/bench/bpf_skel/.gitignore line 4

Quoted 6 lines · Arnaldo Carvalho de Melo

+++ b/tools/perf/bench/bpf_skel/.gitignore

tools/perf/bench/bpf_skel/.gitignore new file +4 -0
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only
+.tmp
+*.skel.h
+vmlinux.h

I think it's enough to add '*.skel.h' only as other files are still under util/bpf_skel. But having others would not be harmful.

Quoted 1 line

⬢ [acme@toolbx perf-tools]$ ls -la tools/perf/bench/bpf_skel/.tmp total 8
drwxr-xr-x. 1 acme acme 36 Jun 23 21:01 .
drwxr-xr-x. 1 acme acme 102 Jun 23 21:01 .. -rw-r--r--. 1 acme acme 7840 Jun 23 21:01 bench_uprobe.bpf.o ⬢ [acme@toolbx perf-tools]$

.tmp is created as well.

- Arnaldo

#3 lore raw
Quoted 2 lines · Arnaldo Carvalho de Melo

.tmp is created as well.

Note that the top-level .gitignore makes sure that we ignore any dot-files by default (along with a lot of the usual patterns, of course - not just object files, but various other binary file endings).

( Yes, gitignore files do allow overrides to "un-ignore" files too, but almost nobody ever uses that, there's seldom any reason for some top-level file to say "ignore all generated files of this pattern" and then a subdirectory gitignore says "but not this pattern". Some crazy directories do say "ignore everything" and then they explicitly unignore some patterns, but honestly, that's a mark of a diseased mind )

Linus

author maintainer
#4 lore raw
Quoted 9 lines · Linus Torvalds
Quoted 2 lines · Arnaldo Carvalho de Melo

.tmp is created as well.

Note that the top-level .gitignore makes sure that we ignore any dot-files by default (along with a lot of the usual patterns, of course - not just object files, but various other binary file endings).

Quoted 7 lines

( Yes, gitignore files do allow overrides to "un-ignore" files too, but almost nobody ever uses that, there's seldom any reason for some top-level file to say "ignore all generated files of this pattern" and then a subdirectory gitignore says "but not this pattern". Some crazy directories do say "ignore everything" and then they explicitly unignore some patterns, but honestly, that's a mark of a diseased mind )

Yeah, but having .tmp there its kinda like not depending on having the prototype for a function indirectly obtained via some include chain, by luck, having .tmp there documents that that thing is (or a strong maybe, in the case of vmlinux.h) generated there and should be ignored.

Anyway, now it is ignored, doubly so in the case of .tmp.

- Arnaldo