Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf dwarf-aux: Move #else block of #ifdef HAVE_DWARF_GETLOCATIONS_SUPPORT code to the header file

It's a usual convention that the conditional code is handled in a header
file. As I'm planning to add some more of them, let's move the current
code to the header first.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: linux-toolchains@vger.kernel.org
Cc: linux-trace-devel@vger.kernel.org
Link: https://lore.kernel.org/r/20231110000012.3538610-6-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
3796eba7 a65e8c0b

+17 -9
-7
tools/perf/util/dwarf-aux.c
··· 1245 1245 out: 1246 1246 return ret; 1247 1247 } 1248 - #else 1249 - int die_get_var_range(Dwarf_Die *sp_die __maybe_unused, 1250 - Dwarf_Die *vr_die __maybe_unused, 1251 - struct strbuf *buf __maybe_unused) 1252 - { 1253 - return -ENOTSUP; 1254 - } 1255 1248 #endif 1256 1249 1257 1250 /*
+17 -2
tools/perf/util/dwarf-aux.h
··· 121 121 122 122 /* Get the name and type of given variable DIE, stored as "type\tname" */ 123 123 int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf); 124 - int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf); 125 124 126 125 /* Check if target program is compiled with optimization */ 127 126 bool die_is_optimized_target(Dwarf_Die *cu_die); ··· 129 130 void die_skip_prologue(Dwarf_Die *sp_die, Dwarf_Die *cu_die, 130 131 Dwarf_Addr *entrypc); 131 132 132 - #endif 133 + #ifdef HAVE_DWARF_GETLOCATIONS_SUPPORT 134 + 135 + /* Get byte offset range of given variable DIE */ 136 + int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf); 137 + 138 + #else /* HAVE_DWARF_GETLOCATIONS_SUPPORT */ 139 + 140 + static inline int die_get_var_range(Dwarf_Die *sp_die __maybe_unused, 141 + Dwarf_Die *vr_die __maybe_unused, 142 + struct strbuf *buf __maybe_unused) 143 + { 144 + return -ENOTSUP; 145 + } 146 + 147 + #endif /* HAVE_DWARF_GETLOCATIONS_SUPPORT */ 148 + 149 + #endif /* _DWARF_AUX_H */