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

perf annotate: Fix build with NO_SLANG=1

The recent change for perf c2c annotate broke build without slang
support like below.

builtin-annotate.c: In function 'hists__find_annotations':
builtin-annotate.c:522:73: error: 'NO_ADDR' undeclared (first use in this function); did you mean 'NR_ADDR'?
522 | key = hist_entry__tui_annotate(he, evsel, NULL, NO_ADDR);
| ^~~~~~~
| NR_ADDR
builtin-annotate.c:522:73: note: each undeclared identifier is reported only once for each function it appears in

builtin-annotate.c:522:31: error: too many arguments to function 'hist_entry__tui_annotate'
522 | key = hist_entry__tui_annotate(he, evsel, NULL, NO_ADDR);
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from util/sort.h:6,
from builtin-annotate.c:28:
util/hist.h:756:19: note: declared here
756 | static inline int hist_entry__tui_annotate(struct hist_entry *he __maybe_unused,
| ^~~~~~~~~~~~~~~~~~~~~~~~

And I noticed that it missed to update the other side of #ifdef
HAVE_SLANG_SUPPORT. Let's fix it.

Cc: Tianyou Li <tianyou.li@intel.com>
Fixes: cd3466cd2639783d ("perf c2c: Add annotation support to perf c2c report")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

+6 -4
+6 -4
tools/perf/util/hist.h
··· 709 709 struct hist_entry he; 710 710 }; 711 711 712 + #define NO_ADDR 0 713 + 712 714 #ifdef HAVE_SLANG_SUPPORT 713 715 #include "../ui/keysyms.h" 714 716 void attr_to_script(char *buf, struct perf_event_attr *attr); 715 - 716 - #define NO_ADDR 0 717 717 718 718 int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *ms, 719 719 struct evsel *evsel, ··· 748 748 static inline int __hist_entry__tui_annotate(struct hist_entry *he __maybe_unused, 749 749 struct map_symbol *ms __maybe_unused, 750 750 struct evsel *evsel __maybe_unused, 751 - struct hist_browser_timer *hbt __maybe_unused) 751 + struct hist_browser_timer *hbt __maybe_unused, 752 + u64 al_addr __maybe_unused) 752 753 { 753 754 return 0; 754 755 } 755 756 756 757 static inline int hist_entry__tui_annotate(struct hist_entry *he __maybe_unused, 757 758 struct evsel *evsel __maybe_unused, 758 - struct hist_browser_timer *hbt __maybe_unused) 759 + struct hist_browser_timer *hbt __maybe_unused, 760 + u64 al_addr __maybe_unused) 759 761 { 760 762 return 0; 761 763 }