Commit 9f6f941e authored by Ingo Molnar's avatar Ingo Molnar
Browse files

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

Merge tag 'perf-core-for-mingo-4.11-20170117' 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:

New features:

 - Account thread wait time (off CPU time) separately: sleep, iowait and
   preempt, based on the prev_state of the last event, show the breakdown
   when using "perf sched timehist --state" (Namhyumg Kim)

Infrastructure changes:

 - Factor out PMU scale conversion code (Andi Kleen)

 - Remove unnecessary feature-dwarf warning (David Carrillo-Cisneros)

 - Add missing member name in OPT_() macros (Soramichi AKIYAMA)

 - Move variables referenced in libperf.a object files from perf's main()
   file, so that other tools can use libperf.a with a different main()
   (Soramichi AKIYAMA)

Documentation changes:

 - Fix 'perf script' man page about --dump-raw-trace option (Michael Petlan)

 - Also allow forcing reading of non-root owned files by root in 'perf
   script' (Yannick Brosseau)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 5b485629 d94386f2
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -133,32 +133,32 @@ struct option {
#define OPT_UINTEGER(s, l, v, h)    { .type = OPTION_UINTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h) }
#define OPT_UINTEGER(s, l, v, h)    { .type = OPTION_UINTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h) }
#define OPT_LONG(s, l, v, h)        { .type = OPTION_LONG, .short_name = (s), .long_name = (l), .value = check_vtype(v, long *), .help = (h) }
#define OPT_LONG(s, l, v, h)        { .type = OPTION_LONG, .short_name = (s), .long_name = (l), .value = check_vtype(v, long *), .help = (h) }
#define OPT_U64(s, l, v, h)         { .type = OPTION_U64, .short_name = (s), .long_name = (l), .value = check_vtype(v, u64 *), .help = (h) }
#define OPT_U64(s, l, v, h)         { .type = OPTION_U64, .short_name = (s), .long_name = (l), .value = check_vtype(v, u64 *), .help = (h) }
#define OPT_STRING(s, l, v, a, h)   { .type = OPTION_STRING,  .short_name = (s), .long_name = (l), .value = check_vtype(v, const char **), (a), .help = (h) }
#define OPT_STRING(s, l, v, a, h)   { .type = OPTION_STRING,  .short_name = (s), .long_name = (l), .value = check_vtype(v, const char **), .argh = (a), .help = (h) }
#define OPT_STRING_OPTARG(s, l, v, a, h, d) \
#define OPT_STRING_OPTARG(s, l, v, a, h, d) \
	{ .type = OPTION_STRING,  .short_name = (s), .long_name = (l), \
	{ .type = OPTION_STRING,  .short_name = (s), .long_name = (l), \
	  .value = check_vtype(v, const char **), (a), .help = (h), \
	  .value = check_vtype(v, const char **), .argh =(a), .help = (h), \
	  .flags = PARSE_OPT_OPTARG, .defval = (intptr_t)(d) }
	  .flags = PARSE_OPT_OPTARG, .defval = (intptr_t)(d) }
#define OPT_STRING_OPTARG_SET(s, l, v, os, a, h, d) \
#define OPT_STRING_OPTARG_SET(s, l, v, os, a, h, d) \
	{ .type = OPTION_STRING, .short_name = (s), .long_name = (l), \
	{ .type = OPTION_STRING, .short_name = (s), .long_name = (l), \
	  .value = check_vtype(v, const char **), (a), .help = (h), \
	  .value = check_vtype(v, const char **), .argh = (a), .help = (h), \
	  .flags = PARSE_OPT_OPTARG, .defval = (intptr_t)(d), \
	  .flags = PARSE_OPT_OPTARG, .defval = (intptr_t)(d), \
	  .set = check_vtype(os, bool *)}
	  .set = check_vtype(os, bool *)}
#define OPT_STRING_NOEMPTY(s, l, v, a, h)   { .type = OPTION_STRING,  .short_name = (s), .long_name = (l), .value = check_vtype(v, const char **), (a), .help = (h), .flags = PARSE_OPT_NOEMPTY}
#define OPT_STRING_NOEMPTY(s, l, v, a, h)   { .type = OPTION_STRING,  .short_name = (s), .long_name = (l), .value = check_vtype(v, const char **), .argh = (a), .help = (h), .flags = PARSE_OPT_NOEMPTY}
#define OPT_DATE(s, l, v, h) \
#define OPT_DATE(s, l, v, h) \
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb }
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb }
#define OPT_CALLBACK(s, l, v, a, h, f) \
#define OPT_CALLBACK(s, l, v, a, h, f) \
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f) }
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f) }
#define OPT_CALLBACK_NOOPT(s, l, v, a, h, f) \
#define OPT_CALLBACK_NOOPT(s, l, v, a, h, f) \
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG }
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG }
#define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \
#define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .defval = (intptr_t)d, .flags = PARSE_OPT_LASTARG_DEFAULT }
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = (a), .help = (h), .callback = (f), .defval = (intptr_t)d, .flags = PARSE_OPT_LASTARG_DEFAULT }
#define OPT_CALLBACK_DEFAULT_NOOPT(s, l, v, a, h, f, d) \
#define OPT_CALLBACK_DEFAULT_NOOPT(s, l, v, a, h, f, d) \
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l),\
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l),\
	.value = (v), (a), .help = (h), .callback = (f), .defval = (intptr_t)d,\
	.value = (v), .arg = (a), .help = (h), .callback = (f), .defval = (intptr_t)d,\
	.flags = PARSE_OPT_LASTARG_DEFAULT | PARSE_OPT_NOARG}
	.flags = PARSE_OPT_LASTARG_DEFAULT | PARSE_OPT_NOARG}
#define OPT_CALLBACK_OPTARG(s, l, v, d, a, h, f) \
#define OPT_CALLBACK_OPTARG(s, l, v, d, a, h, f) \
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), \
	{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), \
	  .value = (v), (a), .help = (h), .callback = (f), \
	  .value = (v), .argh = (a), .help = (h), .callback = (f), \
	  .flags = PARSE_OPT_OPTARG, .data = (d) }
	  .flags = PARSE_OPT_OPTARG, .data = (d) }


/* parse_options() will filter out the processed options and leave the
/* parse_options() will filter out the processed options and leave the
+1 −2
Original line number Original line Diff line number Diff line
@@ -40,8 +40,7 @@ CFLAGS_builtin-help.o += $(paths)
CFLAGS_builtin-timechart.o += $(paths)
CFLAGS_builtin-timechart.o += $(paths)
CFLAGS_perf.o              += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))"	\
CFLAGS_perf.o              += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))"	\
			      -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))"	\
			      -DPERF_EXEC_PATH="BUILD_STR($(perfexecdir_SQ))"	\
			      -DPREFIX="BUILD_STR($(prefix_SQ))"		\
			      -DPREFIX="BUILD_STR($(prefix_SQ))"
			      -include $(OUTPUT)PERF-VERSION-FILE
CFLAGS_builtin-trace.o	   += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))"
CFLAGS_builtin-trace.o	   += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_SQ))"
CFLAGS_builtin-report.o	   += -DTIPDIR="BUILD_STR($(tipdir_SQ))"
CFLAGS_builtin-report.o	   += -DTIPDIR="BUILD_STR($(tipdir_SQ))"
CFLAGS_builtin-report.o	   += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
CFLAGS_builtin-report.o	   += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
+2 −0
Original line number Original line Diff line number Diff line
@@ -143,6 +143,8 @@ OPTIONS for 'perf sched timehist'
	stop time is not given (i.e, time string is 'x.y,') then analysis goes
	stop time is not given (i.e, time string is 'x.y,') then analysis goes
	to end of file.
	to end of file.


--state::
	Show task state when it switched out.


SEE ALSO
SEE ALSO
--------
--------
+2 −2
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ There are several variants of perf script:


  'perf script report <script> [args]' to run and display the results
  'perf script report <script> [args]' to run and display the results
  of <script>.  <script> is the name displayed in the output of 'perf
  of <script>.  <script> is the name displayed in the output of 'perf
  trace --list' i.e. the actual script name minus any language
  script --list' i.e. the actual script name minus any language
  extension.  The perf.data output from a previous run of 'perf script
  extension.  The perf.data output from a previous run of 'perf script
  record <script>' is used and should be present for this command to
  record <script>' is used and should be present for this command to
  succeed.  [args] refers to the (mainly optional) args expected by
  succeed.  [args] refers to the (mainly optional) args expected by
@@ -76,7 +76,7 @@ OPTIONS
	Any command you can specify in a shell.
	Any command you can specify in a shell.


-D::
-D::
--dump-raw-script=::
--dump-raw-trace=::
        Display verbose dump of the trace data.
        Display verbose dump of the trace data.


-L::
-L::
+4 −2
Original line number Original line Diff line number Diff line
@@ -291,8 +291,10 @@ else
      endif
      endif
    endif
    endif
    ifneq ($(feature-dwarf), 1)
    ifneq ($(feature-dwarf), 1)
      ifndef NO_DWARF
        msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
        msg := $(warning No libdw.h found or old libdw.h found or elfutils is older than 0.138, disables dwarf support. Please install new elfutils-devel/libdw-dev);
        NO_DWARF := 1
        NO_DWARF := 1
      endif
    else
    else
      ifneq ($(feature-dwarf_getlocations), 1)
      ifneq ($(feature-dwarf_getlocations), 1)
        msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
        msg := $(warning Old libdw.h, finding variables at given 'perf probe' point will not work, install elfutils-devel/libdw-dev >= 0.157);
Loading