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

Commit b130a699 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-urgent-for-mingo-4.14-20170912' of...

Merge tag 'perf-urgent-for-mingo-4.14-20170912' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

 into perf/urgent

Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

- Fix TUI progress bar when delta from new total from that of the
  previous update is greater than the progress "step" (screen width
  progress bar block))  (Jiri Olsa)

- Make tools/lib/api make DEBUG=1 build use -D_FORTIFY_SOURCE=2 not
  to cripple debuginfo, just like tools/perf/ does (Jiri Olsa)

- Avoid leaking the 'perf.data' file to workloads started from the
  'perf record' command line by using the O_CLOEXEC open flag (Jiri Olsa)

- Fix building when libunwind's 'unwind.h' file is present in the
  include path, clashing with tools/perf/util/unwind.h (Milian Wolff)

- Check per .perfconfig section entry flag, not just per section (Taeung Song)

- Support running perf binaries with a dash in their name, needed to
  run perf as an AppImage (Milian Wolff)

- Wait for the right child by using waitpid() when running workloads
  from 'perf stat', also to fix using perf as an AppImage (Milian Wolff)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 6d8ef53e dfc9eec7
Loading
Loading
Loading
Loading
+6 −3
Original line number Original line Diff line number Diff line
@@ -21,11 +21,14 @@
#define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
#define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))


#define  noinline	__attribute__((noinline))
#define  noinline	__attribute__((noinline))

#ifndef __packed
#define __packed	__attribute__((packed))
#define __packed	__attribute__((packed))

#endif
#ifndef __noreturn
#define __noreturn	__attribute__((noreturn))
#define __noreturn	__attribute__((noreturn))

#endif
#ifndef __aligned
#define __aligned(x)	__attribute__((aligned(x)))
#define __aligned(x)	__attribute__((aligned(x)))
#endif
#define __printf(a, b)	__attribute__((format(printf, a, b)))
#define __printf(a, b)	__attribute__((format(printf, a, b)))
#define __scanf(a, b)	__attribute__((format(scanf, a, b)))
#define __scanf(a, b)	__attribute__((format(scanf, a, b)))
+7 −1
Original line number Original line Diff line number Diff line
@@ -17,13 +17,19 @@ MAKEFLAGS += --no-print-directory
LIBFILE = $(OUTPUT)libapi.a
LIBFILE = $(OUTPUT)libapi.a


CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
CFLAGS := $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fPIC
CFLAGS += -ggdb3 -Wall -Wextra -std=gnu99 -U_FORTIFY_SOURCE -fPIC


ifeq ($(DEBUG),0)
ifeq ($(CC_NO_CLANG), 0)
ifeq ($(CC_NO_CLANG), 0)
  CFLAGS += -O3
  CFLAGS += -O3
else
else
  CFLAGS += -O6
  CFLAGS += -O6
endif
endif
endif

ifeq ($(DEBUG),0)
  CFLAGS += -D_FORTIFY_SOURCE
endif


# Treat warnings as errors unless directed not to
# Treat warnings as errors unless directed not to
ifneq ($(WERROR),0)
ifneq ($(WERROR),0)
+1 −1
Original line number Original line Diff line number Diff line
@@ -59,7 +59,7 @@ static int set_config(struct perf_config_set *set, const char *file_name,
		fprintf(fp, "[%s]\n", section->name);
		fprintf(fp, "[%s]\n", section->name);


		perf_config_items__for_each_entry(&section->items, item) {
		perf_config_items__for_each_entry(&section->items, item) {
			if (!use_system_config && section->from_system_config)
			if (!use_system_config && item->from_system_config)
				continue;
				continue;
			if (item->value)
			if (item->value)
				fprintf(fp, "\t%s = %s\n",
				fprintf(fp, "\t%s = %s\n",
+1 −1
Original line number Original line Diff line number Diff line
@@ -707,7 +707,7 @@ static int __run_perf_stat(int argc, const char **argv)
				process_interval();
				process_interval();
			}
			}
		}
		}
		wait(&status);
		waitpid(child_pid, &status, 0);


		if (workload_exec_errno) {
		if (workload_exec_errno) {
			const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg));
			const char *emsg = str_error_r(workload_exec_errno, msg, sizeof(msg));
+10 −4
Original line number Original line Diff line number Diff line
@@ -467,15 +467,21 @@ int main(int argc, const char **argv)
	 *  - cannot execute it externally (since it would just do
	 *  - cannot execute it externally (since it would just do
	 *    the same thing over again)
	 *    the same thing over again)
	 *
	 *
	 * So we just directly call the internal command handler, and
	 * So we just directly call the internal command handler. If that one
	 * die if that one cannot handle it.
	 * fails to handle this, then maybe we just run a renamed perf binary
	 * that contains a dash in its name. To handle this scenario, we just
	 * fall through and ignore the "xxxx" part of the command string.
	 */
	 */
	if (strstarts(cmd, "perf-")) {
	if (strstarts(cmd, "perf-")) {
		cmd += 5;
		cmd += 5;
		argv[0] = cmd;
		argv[0] = cmd;
		handle_internal_command(argc, argv);
		handle_internal_command(argc, argv);
		fprintf(stderr, "cannot handle %s internally", cmd);
		/*
		goto out;
		 * If the command is handled, the above function does not
		 * return undo changes and fall through in such a case.
		 */
		cmd -= 5;
		argv[0] = cmd;
	}
	}
	if (strstarts(cmd, "trace")) {
	if (strstarts(cmd, "trace")) {
#ifdef HAVE_LIBAUDIT_SUPPORT
#ifdef HAVE_LIBAUDIT_SUPPORT
Loading