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

Commit 21ee2fcb authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-4.11-20170209' of...

Merge tag 'perf-core-for-mingo-4.11-20170209' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

User visible changes:

 - Add support for parsing Intel uncore vendor event files and add uncore
   vendor events for the Intel server processors (Haswell, Broadwell,
   IvyBridge), Xeon Phi (Knights Landing) and Broadwell DE (Andi Kleen)

 - Support --symfs in 'perf probe' (Uwe Kleine-König)

 - Add support for generating bpf prologue on the aarch64 architecture (He Kuang)

 - Show proper hint when SDT event not yet in place via 'perf probe' (Ravi Bangoria)

 - Take into account symfs setting when reading file build ID (Victor Kamensky)

Infrastructure changes:

 - Map gcc7's '__attribute__ ((fallthrough))', that warns when code
   associated to case blocks in switches continue into the next case entry,
   to '__falltrough' and use it where warned by gcc, tested on Fedora Rawhide
   (Arnaldo Carvalho de Melo)

 - Fix buffer sizes used with snprintf that could lead to truncation,
   another warning introduced in gcc7 (Arnaldo Carvalho de Melo)

 - Robustify do_generate_dynamic_list_file in libtraceevent (David Carrillo-Cisneros)

 - Use zfree() in more places (Taeung Song)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents b6263178 7ea6856d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -126,4 +126,13 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
#define WRITE_ONCE(x, val) \
	({ union { typeof(x) __val; char __c[1]; } __u = { .__val = (val) }; __write_once_size(&(x), __u.__c, sizeof(x)); __u.__val; })


#ifndef __fallthrough
# if defined(__GNUC__) && __GNUC__ >= 7
#  define __fallthrough __attribute__ ((fallthrough))
# else
#  define __fallthrough
# endif
#endif

#endif /* _TOOLS_LINUX_COMPILER_H */
+18 −14
Original line number Diff line number Diff line
@@ -86,9 +86,13 @@ void put_tracing_file(char *file)
	free(file);
}

static int strerror_open(int err, char *buf, size_t size, const char *filename)
int tracing_path__strerror_open_tp(int err, char *buf, size_t size,
				   const char *sys, const char *name)
{
	char sbuf[128];
	char filename[PATH_MAX];

	snprintf(filename, PATH_MAX, "%s/%s", sys, name ?: "*");

	switch (err) {
	case ENOENT:
@@ -99,10 +103,19 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)
		 * - jirka
		 */
		if (debugfs__configured() || tracefs__configured()) {
			/* sdt markers */
			if (!strncmp(filename, "sdt_", 4)) {
				snprintf(buf, size,
					"Error:\tFile %s/%s not found.\n"
					"Hint:\tSDT event cannot be directly recorded on.\n"
					"\tPlease first use 'perf probe %s:%s' before recording it.\n",
					tracing_events_path, filename, sys, name);
			} else {
				snprintf(buf, size,
					 "Error:\tFile %s/%s not found.\n"
					 "Hint:\tPerhaps this kernel misses some CONFIG_ setting to enable this feature?.\n",
					 tracing_events_path, filename);
			}
			break;
		}
		snprintf(buf, size, "%s",
@@ -125,12 +138,3 @@ static int strerror_open(int err, char *buf, size_t size, const char *filename)

	return 0;
}

int tracing_path__strerror_open_tp(int err, char *buf, size_t size, const char *sys, const char *name)
{
	char path[PATH_MAX];

	snprintf(path, PATH_MAX, "%s/%s", sys, name ?: "*");

	return strerror_open(err, buf, size, path);
}
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#define __BPF_BPF_H

#include <linux/bpf.h>
#include <stddef.h>

int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
		   int max_entries, __u32 map_flags);
+10 −4
Original line number Diff line number Diff line
@@ -257,10 +257,16 @@ define do_install_plugins
endef

define do_generate_dynamic_list_file
	symbol_type=`$(NM) -u -D $1 | awk 'NF>1 {print $$1}' | \
	xargs echo "U W w" | tr ' ' '\n' | sort -u | xargs echo`;\
	if [ "$$symbol_type" = "U W w" ];then				\
		(echo '{';						\
		$(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\
		echo '};';						\
	) > $2
		) > $2;							\
	else								\
		(echo Either missing one of [$1] or bad version of $(NM)) 1>&2;\
	fi
endef

install_lib: all_cmd install_plugins
+1 −0
Original line number Diff line number Diff line
@@ -2,3 +2,4 @@ ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
PERF_HAVE_JITDUMP := 1
PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
Loading