1
0
Fork 0

perf/core improvements:

User visible:
 
 . Improve 'perf probe' error messages, moving some diagnostic messages to
   only appear in --verbose mode and fixing up some error reporting related
   to variables and struct members. (Masami Hiramatsu)
 
 . Reflow 'perf timechart' man page. (Stanislav Fomichev)
 
 Developer stuff:
 
 . Be more precise when reporting missing libraries in a static tool build.
   (Arnaldo Carvalho de Melo)
 
 . Show error messages from the multiple make invoked from 'make build-test'.
   (Arnaldo Carvalho de Melo)
 
 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJTlxjYAAoJENZQFvNTUqpA5b4P/1Qs0S/HqAsVCqQe9143IxNS
 HY0NrhBGm05rbYga+Bvp6lp9xXf3F9hp7i3rFANgB68sHLEmi8DU9T5vmvrq9TIU
 +KT102re7eA/93rVQ+cvBqaosQVh8ia7O2tnr+FEhyBCNOIwTqtUI4g+9/IJB3h9
 0xxsYLR2SZtV9aSZKXdSjOZ0wh8l0D1VjuCQd5wqYvqQ8r+1nOImKX3Y02Byftns
 ZH/MkYtkmUbdFMdenRN2lJenDnIPji9AESPnTcZbXS23IIgnpOicgtRcrt9LVK4Y
 Ty+ooLXmf57uXkoFpM4DMybuyUGH3xw44TB0PqZuBJ1Psgdm5SzdJfLshUKptLFc
 XvxN8yaWSvOz2Bu/tS17o+PzXYdgk3Ar8UCWSYtkFDmfbaZC6RYzMfgHZnYsVlrf
 ZjcIviBqkbHpTFkV3PJZi6PnvKCiNUj2rA5rv9ltc2XPMgHEGhqT7lxGgh0iGd/O
 c8Wt/TjB6CRuMqk6N4Epb/yIIYbL01Ax3GdR1yw4exG7W75hLz+BBrT7P51Ivdg2
 Ke2ysjpbARamBY3XOxCqA3zfWlhHdH1PrBexEkEa1+4ALk0W8TtEhkNgw+ZEiT9H
 HbWXi9KwrNff0RAgzx2o9XiwO8iG/wLgO5AU0CNY9L2s7gosxE8BnSoPnvdVqhvl
 lt/m+f8SKYavUlHNxvC3
 =37tZ
 -----END PGP SIGNATURE-----

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

Pull perf/core improvements from Arnaldo Carvalho de Melo:

User visible:

  * Improve 'perf probe' error messages, moving some diagnostic messages to
    only appear in --verbose mode and fixing up some error reporting related
    to variables and struct members. (Masami Hiramatsu)

  * Reflow 'perf timechart' man page. (Stanislav Fomichev)

Developer stuff:

  * Be more precise when reporting missing libraries in a static tool build.
    (Arnaldo Carvalho de Melo)

  * Show error messages from the multiple make invoked from 'make build-test'.
    (Arnaldo Carvalho de Melo)

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
hifive-unleashed-5.1
Ingo Molnar 2014-06-12 13:54:42 +02:00
commit 7184062b94
6 changed files with 57 additions and 44 deletions

View File

@ -43,27 +43,6 @@ TIMECHART OPTIONS
--symfs=<directory>::
Look for files with symbols relative to this directory.
EXAMPLES
--------
$ perf timechart record git pull
[ perf record: Woken up 13 times to write data ]
[ perf record: Captured and wrote 4.253 MB perf.data (~185801 samples) ]
$ perf timechart
Written 10.2 seconds of trace to output.svg.
Record system-wide timechart:
$ perf timechart record
then generate timechart and highlight 'gcc' tasks:
$ perf timechart --highlight gcc
-n::
--proc-num::
Print task info for at least given number of tasks.
@ -88,6 +67,26 @@ RECORD OPTIONS
--callchain::
Do call-graph (stack chain/backtrace) recording
EXAMPLES
--------
$ perf timechart record git pull
[ perf record: Woken up 13 times to write data ]
[ perf record: Captured and wrote 4.253 MB perf.data (~185801 samples) ]
$ perf timechart
Written 10.2 seconds of trace to output.svg.
Record system-wide timechart:
$ perf timechart record
then generate timechart and highlight 'gcc' tasks:
$ perf timechart --highlight gcc
SEE ALSO
--------
linkperf:perf-record[1]

View File

@ -288,6 +288,13 @@ static void cleanup_params(void)
memset(&params, 0, sizeof(params));
}
static void pr_err_with_code(const char *msg, int err)
{
pr_err("%s", msg);
pr_debug(" Reason: %s (Code: %d)", strerror(-err), err);
pr_err("\n");
}
static int
__cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
{
@ -379,7 +386,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
}
ret = parse_probe_event_argv(argc, argv);
if (ret < 0) {
pr_err(" Error: Parse Error. (%d)\n", ret);
pr_err_with_code(" Error: Command Parse Error.", ret);
return ret;
}
}
@ -419,8 +426,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
}
ret = show_perf_probe_events();
if (ret < 0)
pr_err(" Error: Failed to show event list. (%d)\n",
ret);
pr_err_with_code(" Error: Failed to show event list.", ret);
return ret;
}
if (params.show_funcs) {
@ -445,8 +451,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
strfilter__delete(params.filter);
params.filter = NULL;
if (ret < 0)
pr_err(" Error: Failed to show functions."
" (%d)\n", ret);
pr_err_with_code(" Error: Failed to show functions.", ret);
return ret;
}
@ -464,7 +469,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
ret = show_line_range(&params.line_range, params.target);
if (ret < 0)
pr_err(" Error: Failed to show lines. (%d)\n", ret);
pr_err_with_code(" Error: Failed to show lines.", ret);
return ret;
}
if (params.show_vars) {
@ -485,7 +490,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
strfilter__delete(params.filter);
params.filter = NULL;
if (ret < 0)
pr_err(" Error: Failed to show vars. (%d)\n", ret);
pr_err_with_code(" Error: Failed to show vars.", ret);
return ret;
}
#endif
@ -493,7 +498,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
if (params.dellist) {
ret = del_perf_probe_events(params.dellist);
if (ret < 0) {
pr_err(" Error: Failed to delete events. (%d)\n", ret);
pr_err_with_code(" Error: Failed to delete events.", ret);
return ret;
}
}
@ -504,7 +509,7 @@ __cmd_probe(int argc, const char **argv, const char *prefix __maybe_unused)
params.target,
params.force_add);
if (ret < 0) {
pr_err(" Error: Failed to add events. (%d)\n", ret);
pr_err_with_code(" Error: Failed to add events.", ret);
return ret;
}
}

View File

@ -299,7 +299,11 @@ else
NO_LIBUNWIND := 1
NO_LIBDW_DWARF_UNWIND := 1
else
msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]/glibc-static);
ifneq ($(filter s% -static%,$(LDFLAGS),),)
msg := $(error No static glibc found, please install glibc-static);
else
msg := $(error No gnu/libc-version.h found, please install glibc-dev[el]);
endif
endif
else
ifndef NO_LIBDW_DWARF_UNWIND

View File

@ -205,8 +205,7 @@ $(run):
( eval $$cmd ) >> $@ 2>&1; \
echo " test: $(call test,$@)" >> $@ 2>&1; \
$(call test,$@) && \
rm -f $@ \
rm -rf $$TMP_DEST
rm -rf $@ $$TMP_DEST || (cat $@ ; false)
$(run_O):
$(call clean)
@ -217,9 +216,7 @@ $(run_O):
( eval $$cmd ) >> $@ 2>&1 && \
echo " test: $(call test_O,$@)" >> $@ 2>&1; \
$(call test_O,$@) && \
rm -f $@ && \
rm -rf $$TMP_O \
rm -rf $$TMP_DEST
rm -rf $@ $$TMP_O $$TMP_DEST || (cat $@ ; false)
tarpkg:
@cmd="$(PERF)/tests/perf-targz-src-pkg $(PERF)"; \

View File

@ -628,11 +628,11 @@ static int __show_line_range(struct line_range *lr, const char *module)
ret = debuginfo__find_line_range(dinfo, lr);
debuginfo__delete(dinfo);
if (ret == 0) {
if (ret == 0 || ret == -ENOENT) {
pr_warning("Specified source line is not found.\n");
return -ENOENT;
} else if (ret < 0) {
pr_warning("Debuginfo analysis failed. (%d)\n", ret);
pr_warning("Debuginfo analysis failed.\n");
return ret;
}
@ -641,7 +641,7 @@ static int __show_line_range(struct line_range *lr, const char *module)
ret = get_real_path(tmp, lr->comp_dir, &lr->path);
free(tmp); /* Free old path */
if (ret < 0) {
pr_warning("Failed to find source file. (%d)\n", ret);
pr_warning("Failed to find source file path.\n");
return ret;
}
@ -721,9 +721,14 @@ static int show_available_vars_at(struct debuginfo *dinfo,
ret = debuginfo__find_available_vars_at(dinfo, pev, &vls,
max_vls, externs);
if (ret <= 0) {
pr_err("Failed to find variables at %s (%d)\n", buf, ret);
if (ret == 0 || ret == -ENOENT) {
pr_err("Failed to find the address of %s\n", buf);
ret = -ENOENT;
} else
pr_warning("Debuginfo analysis failed.\n");
goto end;
}
/* Some variables are found */
fprintf(stdout, "Available variables at %s\n", buf);
for (i = 0; i < ret; i++) {

View File

@ -573,14 +573,13 @@ static int find_variable(Dwarf_Die *sc_die, struct probe_finder *pf)
if (!die_find_variable_at(sc_die, pf->pvar->var, pf->addr, &vr_die)) {
/* Search again in global variables */
if (!die_find_variable_at(&pf->cu_die, pf->pvar->var, 0, &vr_die))
pr_warning("Failed to find '%s' in this function.\n",
pf->pvar->var);
ret = -ENOENT;
}
if (ret >= 0)
ret = convert_variable(&vr_die, pf);
if (ret < 0)
pr_warning("Failed to find '%s' in this function.\n",
pf->pvar->var);
return ret;
}
@ -1281,7 +1280,11 @@ out:
return ret;
}
/* Find available variables at given probe point */
/*
* Find available variables at given probe point
* Return the number of found probe points. Return 0 if there is no
* matched probe point. Return <0 if an error occurs.
*/
int debuginfo__find_available_vars_at(struct debuginfo *dbg,
struct perf_probe_event *pev,
struct variable_list **vls,