linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUGFIX PATCH perf/core ] perf-probe: Fix to add missed brace around if block
@ 2015-08-12 21:55 Masami Hiramatsu
  2015-08-13 18:09 ` Arnaldo Carvalho de Melo
  2015-08-20  9:55 ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu
  0 siblings, 2 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2015-08-12 21:55 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Namhyung Kim, Jiri Olsa, Linux Kernel Mailing List, David Ahern

The commit 75186a9b09e4 (perf probe: Fix to show lines of
sys_ functions correctly) introduced a bug by a missed brace
around if block. This fixes to add it.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---
 tools/perf/util/dwarf-aux.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index 445f455..a509aa84 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -770,7 +770,7 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
 			continue;
 		}
 		/* Filter lines based on address */
-		if (rt_die != cu_die)
+		if (rt_die != cu_die) {
 			/*
 			 * Address filtering
 			 * The line is included in given function, and
@@ -784,6 +784,7 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
 				    decf != dwarf_decl_file(&die_mem))
 					continue;
 			}
+		}
 		/* Get source line */
 		fname = dwarf_linesrc(line, NULL, NULL);
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [BUGFIX PATCH perf/core ] perf-probe: Fix to add missed brace around if block
  2015-08-12 21:55 [BUGFIX PATCH perf/core ] perf-probe: Fix to add missed brace around if block Masami Hiramatsu
@ 2015-08-13 18:09 ` Arnaldo Carvalho de Melo
  2015-08-20  9:55 ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-13 18:09 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Namhyung Kim, Jiri Olsa, Linux Kernel Mailing List, David Ahern,
	Brendan Gregg

Em Thu, Aug 13, 2015 at 06:55:41AM +0900, Masami Hiramatsu escreveu:
> The commit 75186a9b09e4 (perf probe: Fix to show lines of
> sys_ functions correctly) introduced a bug by a missed brace
> around if block. This fixes to add it.
> 
> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thanks! now it works:

  [root@zoo ~]# perf probe 'get_timeval=sys_select:11 tv_sec=tv.tv_sec tv_usec=tv.tv_usec'
  Added new event:
    probe:get_timeval    (on sys_select:11 with tv_sec=tv.tv_sec tv_usec=tv.tv_usec)

  You can now use it in all perf tools, such as:

	perf record -e probe:get_timeval -aR sleep 1

  [root@zoo ~]# perf probe -l
    probe:get_timeval    (on SYSC_select:11@/home/git/linux/fs/select.c with tv_sec tv_usec)
    probe:vfs_getname    (on getname_flags:72@/home/git/linux/fs/namei.c with pathname)
  [root@zoo ~]#

Now we have:

  # strace -e select -p 960
  Process 960 attached
  select(13, [4 5 7 9 10 11 12], [], [5], {10, 0}) = 0 (Timeout)
  select(13, [4 5 7 9 10 11 12], [], [5], {9, 999999}) = 0 (Timeout)
  select(13, [4 5 7 9 10 11 12], [], [5], {10, 0}) = 0 (Timeout)
  select(13, [4 5 7 9 10 11 12], [], [5], {10, 0}) = 0 (Timeout)
  select(13, [4 5 7 9 10 11 12], [], [5], {0, 3072}) = 0 (Timeout)

At the same time as:

 # trace --ev probe:get_timeval -e select -p 960
     0.322 ( 0.013 ms): select(n: 13, inp: 0x55ac425996c0, outp: 0x55ac42599750, exp: 0x55ac425997e0, tvp: 0x7ffd3371fa30) ...
     0.322 (         ): probe:get_timeval:(ffffffff81228f15) tv_sec=10 tv_usec=0)
 10022.189 (10021.880 ms):  ... [continued]: select()) = 0 Timeout
 10022.681 ( 0.043 ms): select(n: 13, inp: 0x55ac425996c0, outp: 0x55ac42599750, exp: 0x55ac425997e0, tvp: 0x7ffd3371fa30) ...
 10022.681 (         ): probe:get_timeval:(ffffffff81228f15) tv_sec=9 tv_usec=999999)
 20040.673 (10018.035 ms):  ... [continued]: select()) = 0 Timeout
 20041.174 ( 0.046 ms): select(n: 13, inp: 0x55ac425996c0, outp: 0x55ac42599750, exp: 0x55ac425997e0, tvp: 0x7ffd3371fa30) ...
 20041.174 (         ): probe:get_timeval:(ffffffff81228f15) tv_sec=10 tv_usec=0)
 30063.041 (10021.912 ms):  ... [continued]: select()) = 0 Timeout
 30063.581 ( 0.042 ms): select(n: 13, inp: 0x55ac425996c0, outp: 0x55ac42599750, exp: 0x55ac425997e0, tvp: 0x7ffd3371fa30) ...
 30063.581 (         ): probe:get_timeval:(ffffffff81228f15) tv_sec=10 tv_usec=0)
 40085.448 (10021.909 ms):  ... [continued]: select()) = 0 Timeout
 40087.983 ( 0.033 ms): select(n: 13, inp: 0x55ac425996c0, outp: 0x55ac42599750, exp: 0x55ac425997e0, tvp: 0x7ffd3371fa30) ...
 40087.983 (         ): probe:get_timeval:(ffffffff81228f15) tv_sec=0 tv_usec=3072)
 40091.202 ( 3.252 ms):  ... [continued]: select()) = 0 Timeout

Seems to be working, now its just to add support in 'perf trace' for a
"get_timeval" wannabe tracepoint in the same fashion as there is support for
another wannabe tracepoint: "vfs_getname", add more of these where timevals are
copied from the kernel, etc.

Anyway, now 'perf probe' suits my needs with syscalls, applied!

Thanks,

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf probe: Fix to add missed brace around if block
  2015-08-12 21:55 [BUGFIX PATCH perf/core ] perf-probe: Fix to add missed brace around if block Masami Hiramatsu
  2015-08-13 18:09 ` Arnaldo Carvalho de Melo
@ 2015-08-20  9:55 ` tip-bot for Masami Hiramatsu
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2015-08-20  9:55 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dsahern, acme, tglx, jolsa, hpa, mingo, linux-kernel,
	masami.hiramatsu.pt, namhyung

Commit-ID:  86a76027457633488b0a83d5e2bb944159885605
Gitweb:     http://git.kernel.org/tip/86a76027457633488b0a83d5e2bb944159885605
Author:     Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
AuthorDate: Thu, 13 Aug 2015 06:55:41 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 13 Aug 2015 14:51:26 -0300

perf probe: Fix to add missed brace around if block

The commit 75186a9b09e4 (perf probe: Fix to show lines of sys_ functions
correctly) introduced a bug by a missed brace around if block. This
fixes to add it.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: 75186a9b09e4 ("perf probe: Fix to show lines of sys_ functions correctly")
Link: http://lkml.kernel.org/r/20150812215541.9088.62425.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/dwarf-aux.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index 445f455..a509aa84 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -770,7 +770,7 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
 			continue;
 		}
 		/* Filter lines based on address */
-		if (rt_die != cu_die)
+		if (rt_die != cu_die) {
 			/*
 			 * Address filtering
 			 * The line is included in given function, and
@@ -784,6 +784,7 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
 				    decf != dwarf_decl_file(&die_mem))
 					continue;
 			}
+		}
 		/* Get source line */
 		fname = dwarf_linesrc(line, NULL, NULL);
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-20  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-12 21:55 [BUGFIX PATCH perf/core ] perf-probe: Fix to add missed brace around if block Masami Hiramatsu
2015-08-13 18:09 ` Arnaldo Carvalho de Melo
2015-08-20  9:55 ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).