Skip to content

Commit a0bf225

Browse files
committed
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/urgent fixes from Arnaldo Carvalho de Melo: . perf probe: Fix segfault due to testing the wrong pointer for NULL, from Ananth N Mavinakayanahalli. . libtraceevent: Remove hard coded include to /usr/local/include in Makefile, which causes cross builds to include host header files, fix from Jack Mitchell. . perf record: Use the right target interface for synthesizing threads when --cpu/-C option is used, fix from Jiri Olsa. . Check if -DFORTIFY_SOURCE=2 is allowed, as gcc 4.7.2 defines it and then the build is broken when it is redefined in perf, fix from Marcin Slusarz. . Fix build with NO_NEWT=1, that can happen explicitely or when the newt-devel package is not installed, from Michael Ellerman. . perf/POWER7: Create a sysfs format entry for Power7 events, missing patch from a patchseries already merged, from Sukadev Bhattiprolu. . Fix LIBNUMA build with glibc 2.12 and older, from Vinson Lee. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
2 parents 1f1b396 + d1398cc commit a0bf225

7 files changed

Lines changed: 53 additions & 7 deletions

File tree

‎arch/powerpc/perf/power7-pmu.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,20 @@ static struct attribute_group power7_pmu_events_group = {
420420
.attrs = power7_events_attr,
421421
};
422422

423+
PMU_FORMAT_ATTR(event, "config:0-19");
424+
425+
static struct attribute *power7_pmu_format_attr[] = {
426+
&format_attr_event.attr,
427+
NULL,
428+
};
429+
430+
struct attribute_group power7_pmu_format_group = {
431+
.name = "format",
432+
.attrs = power7_pmu_format_attr,
433+
};
434+
423435
static const struct attribute_group *power7_pmu_attr_groups[] = {
436+
&power7_pmu_format_group,
424437
&power7_pmu_events_group,
425438
NULL,
426439
};

‎tools/lib/traceevent/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export Q VERBOSE
122122

123123
EVENT_PARSE_VERSION = $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION)
124124

125-
INCLUDES = -I. -I/usr/local/include $(CONFIG_INCLUDES)
125+
INCLUDES = -I. $(CONFIG_INCLUDES)
126126

127127
# Set compile option CFLAGS if not set elsewhere
128128
CFLAGS ?= -g -Wall

‎tools/perf/Makefile‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ifeq ("$(origin DEBUG)", "command line")
9595
PERF_DEBUG = $(DEBUG)
9696
endif
9797
ifndef PERF_DEBUG
98-
CFLAGS_OPTIMIZE = -O6 -D_FORTIFY_SOURCE=2
98+
CFLAGS_OPTIMIZE = -O6
9999
endif
100100

101101
ifdef PARSER_DEBUG
@@ -180,6 +180,12 @@ ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -Werror -Wvolatile-register-var,-W
180180
CFLAGS := $(CFLAGS) -Wvolatile-register-var
181181
endif
182182

183+
ifndef PERF_DEBUG
184+
ifeq ($(call try-cc,$(SOURCE_HELLO),$(CFLAGS) -D_FORTIFY_SOURCE=2,-D_FORTIFY_SOURCE=2),y)
185+
CFLAGS := $(CFLAGS) -D_FORTIFY_SOURCE=2
186+
endif
187+
endif
188+
183189
### --- END CONFIGURATION SECTION ---
184190

185191
ifeq ($(srctree),)

‎tools/perf/bench/bench.h‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
#ifndef BENCH_H
22
#define BENCH_H
33

4+
/*
5+
* The madvise transparent hugepage constants were added in glibc
6+
* 2.13. For compatibility with older versions of glibc, define these
7+
* tokens if they are not already defined.
8+
*
9+
* PA-RISC uses different madvise values from other architectures and
10+
* needs to be special-cased.
11+
*/
12+
#ifdef __hppa__
13+
# ifndef MADV_HUGEPAGE
14+
# define MADV_HUGEPAGE 67
15+
# endif
16+
# ifndef MADV_NOHUGEPAGE
17+
# define MADV_NOHUGEPAGE 68
18+
# endif
19+
#else
20+
# ifndef MADV_HUGEPAGE
21+
# define MADV_HUGEPAGE 14
22+
# endif
23+
# ifndef MADV_NOHUGEPAGE
24+
# define MADV_NOHUGEPAGE 15
25+
# endif
26+
#endif
27+
428
extern int bench_numa(int argc, const char **argv, const char *prefix);
529
extern int bench_sched_messaging(int argc, const char **argv, const char *prefix);
630
extern int bench_sched_pipe(int argc, const char **argv, const char *prefix);

‎tools/perf/builtin-record.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,13 +573,15 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
573573
perf_event__synthesize_guest_os, tool);
574574
}
575575

576-
if (!opts->target.system_wide)
576+
if (perf_target__has_task(&opts->target))
577577
err = perf_event__synthesize_thread_map(tool, evsel_list->threads,
578578
process_synthesized_event,
579579
machine);
580-
else
580+
else if (perf_target__has_cpu(&opts->target))
581581
err = perf_event__synthesize_threads(tool, process_synthesized_event,
582582
machine);
583+
else /* command specified */
584+
err = 0;
583585

584586
if (err != 0)
585587
goto out_delete_session;

‎tools/perf/util/hist.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,9 @@ static inline int script_browse(const char *script_opt __maybe_unused)
208208
return 0;
209209
}
210210

211-
#define K_LEFT -1
212-
#define K_RIGHT -2
211+
#define K_LEFT -1000
212+
#define K_RIGHT -2000
213+
#define K_SWITCH_INPUT_DATA -3000
213214
#endif
214215

215216
#ifdef GTK2_SUPPORT

‎tools/perf/util/strlist.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct strlist *strlist__new(bool dupstr, const char *list)
143143
slist->rblist.node_delete = strlist__node_delete;
144144

145145
slist->dupstr = dupstr;
146-
if (slist && strlist__parse_list(slist, list) != 0)
146+
if (list && strlist__parse_list(slist, list) != 0)
147147
goto out_error;
148148
}
149149

0 commit comments

Comments
 (0)