Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96ee0499 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar.

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf tools, x86: Build perf on older user-space as well
  perf tools: Use scnprintf where applicable
  perf tools: Incorrect use of snprintf results in SEGV
parents cb1ecf25 89c5bd08
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -249,6 +249,8 @@ LIB_H += util/include/asm/uaccess.h
LIB_H += util/include/dwarf-regs.h
LIB_H += util/include/asm/dwarf2.h
LIB_H += util/include/asm/cpufeature.h
LIB_H += util/include/asm/unistd_32.h
LIB_H += util/include/asm/unistd_64.h
LIB_H += perf.h
LIB_H += util/annotate.h
LIB_H += util/cache.h
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ get_cpuid(char *buffer, size_t sz)

	pvr = mfspr(SPRN_PVR);

	nb = snprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr));
	nb = scnprintf(buffer, sz, "%lu,%lu$", PVR_VER(pvr), PVR_REV(pvr));

	/* look for end marker to ensure the entire data fit */
	if (strchr(buffer, '$')) {
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ get_cpuid(char *buffer, size_t sz)
		if (family >= 0x6)
			model += ((a >> 16) & 0xf) << 4;
	}
	nb = snprintf(buffer, sz, "%s,%u,%u,%u$", vendor, family, model, step);
	nb = scnprintf(buffer, sz, "%s,%u,%u,%u$", vendor, family, model, step);

	/* look for end marker to ensure the entire data fit */
	if (strchr(buffer, '$')) {
+6 −0
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@ void get_term_dimensions(struct winsize *ws);
#define rmb()		asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
#define cpu_relax()	asm volatile("rep; nop" ::: "memory");
#define CPUINFO_PROC	"model name"
#ifndef __NR_perf_event_open
# define __NR_perf_event_open 336
#endif
#endif

#if defined(__x86_64__)
@@ -17,6 +20,9 @@ void get_term_dimensions(struct winsize *ws);
#define rmb()		asm volatile("lfence" ::: "memory")
#define cpu_relax()	asm volatile("rep; nop" ::: "memory");
#define CPUINFO_PROC	"model name"
#ifndef __NR_perf_event_open
# define __NR_perf_event_open 298
#endif
#endif

#ifdef __powerpc__
+5 −4
Original line number Diff line number Diff line
#include <linux/kernel.h>
#include "cache.h"
#include "color.h"

@@ -182,12 +183,12 @@ static int __color_vsnprintf(char *bf, size_t size, const char *color,
	}

	if (perf_use_color_default && *color)
		r += snprintf(bf, size, "%s", color);
	r += vsnprintf(bf + r, size - r, fmt, args);
		r += scnprintf(bf, size, "%s", color);
	r += vscnprintf(bf + r, size - r, fmt, args);
	if (perf_use_color_default && *color)
		r += snprintf(bf + r, size - r, "%s", PERF_COLOR_RESET);
		r += scnprintf(bf + r, size - r, "%s", PERF_COLOR_RESET);
	if (trail)
		r += snprintf(bf + r, size - r, "%s", trail);
		r += scnprintf(bf + r, size - r, "%s", trail);
	return r;
}

Loading