Skip to contentSkip to conversation

btf_encoder: Move btf_elf__verbose/btf_elf__force setup

PATCH Applied Jiri Olsa 2 participants 2 messages Nov 16, 2020 BPF

lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 btf_encoder: Move btf_elf__verbose/btf_elf__force setup

With introduction of collect_symbols function, we moved the percpu variables code before btf_elf__verbose/btf_elf__force setup, so they don't have any effect in that code anymore.

Also btf_elf__verbose is used in code that prepares ftrace filter for functions generations, also called within collect_symbols function.

Moving btf_elf__verbose/btf_elf__force setup early in the cu__encode_btf function, so we can get verbose messages and see the effect of the force option.

---
 btf_encoder.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
btf_encoder.c +3 -2
index f3f6291391ee..4f856cfd5577 100644
@@ -540,6 +540,9 @@ int cu__encode_btf(struct cu *cu, int verbose, bool force,
 	struct tag *pos;
 	int err = 0;
 
+	btf_elf__verbose = verbose;
+	btf_elf__force = force;
+
 	if (btfe && strcmp(btfe->filename, cu->filename)) {
 		err = btf_encoder__encode();
 		if (err)
@@ -579,8 +582,6 @@ int cu__encode_btf(struct cu *cu, int verbose, bool force,
 		}
 	}
 
-	btf_elf__verbose = verbose;
-	btf_elf__force = force;
 	type_id_off = btf__get_nr_types(btfe->btf);
 
 	cu__for_each_type(cu, core_id, pos) {
Signature · 1 line
2.26.2
#1 lore raw

Em Mon, Nov 16, 2020 at 08:33:48PM +0100, Jiri Olsa escreveu:

Quoted 11 lines

With introduction of collect_symbols function, we moved the percpu variables code before btf_elf__verbose/btf_elf__force setup, so they don't have any effect in that code anymore.

Also btf_elf__verbose is used in code that prepares ftrace filter for functions generations, also called within collect_symbols function.

Moving btf_elf__verbose/btf_elf__force setup early in the cu__encode_btf function, so we can get verbose messages and see the effect of the force option.

Thanks, applied.

- Arnaldo

Quoted 31 lines
---
 btf_encoder.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
btf_encoder.c +3 -2
index f3f6291391ee..4f856cfd5577 100644
@@ -540,6 +540,9 @@ int cu__encode_btf(struct cu *cu, int verbose, bool force,
 	struct tag *pos;
 	int err = 0;
 
+	btf_elf__verbose = verbose;
+	btf_elf__force = force;
+
 	if (btfe && strcmp(btfe->filename, cu->filename)) {
 		err = btf_encoder__encode();
 		if (err)
@@ -579,8 +582,6 @@ int cu__encode_btf(struct cu *cu, int verbose, bool force,
 		}
 	}
 
-	btf_elf__verbose = verbose;
-	btf_elf__force = force;
 	type_id_off = btf__get_nr_types(btfe->btf);
 
 	cu__for_each_type(cu, core_id, pos) {
Signature · 1 line
2.26.2
Signature · 1 line
- Arnaldo