All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf probe: Fix concat_probe_trace_events
@ 2017-03-08  6:59 Ravi Bangoria
  2017-03-08  6:59 ` [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events Ravi Bangoria
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ravi Bangoria @ 2017-03-08  6:59 UTC (permalink / raw)
  To: mhiramat, acme
  Cc: peterz, mingo, alexander.shishkin, linux-kernel, Ravi Bangoria

'*ntevs' contains number of elements present in 'tevs' array. If
there are no elements in array, 'tevs2' can be directly assigned
to 'tevs' without allocating more space. So the condition should
be  '*ntevs == 0'  not  'ntevs == 0'.

Fixes: 42bba263eb58 ("perf probe: Allow wildcard for cached events")
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/perf/util/probe-event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 28fb62c..4f9d6ee 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -3057,7 +3057,7 @@ concat_probe_trace_events(struct probe_trace_event **tevs, int *ntevs,
 	struct probe_trace_event *new_tevs;
 	int ret = 0;
 
-	if (ntevs == 0) {
+	if (*ntevs == 0) {
 		*tevs = *tevs2;
 		*ntevs = ntevs2;
 		*tevs2 = NULL;
-- 
2.9.3

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

* [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events
  2017-03-08  6:59 [PATCH 1/2] perf probe: Fix concat_probe_trace_events Ravi Bangoria
@ 2017-03-08  6:59 ` Ravi Bangoria
  2017-03-08  9:43   ` Masami Hiramatsu
  2017-03-08  8:37 ` [PATCH 1/2] perf probe: Fix concat_probe_trace_events Masami Hiramatsu
  2017-03-21  6:53 ` [tip:perf/core] " tip-bot for Ravi Bangoria
  2 siblings, 1 reply; 8+ messages in thread
From: Ravi Bangoria @ 2017-03-08  6:59 UTC (permalink / raw)
  To: mhiramat, acme
  Cc: peterz, mingo, alexander.shishkin, linux-kernel, Ravi Bangoria

I don't see any user of this function. This function was being copied
to tools/perf/builtin-probe.c by commit b02137cc6550 ("perf probe: Move
print logic into cmd_probe()"). Since then it has became stale.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
---
 tools/perf/util/probe-event.c | 18 ------------------
 1 file changed, 18 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 4f9d6ee..9f18204 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -3361,24 +3361,6 @@ void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs)
 	}
 }
 
-int add_perf_probe_events(struct perf_probe_event *pevs, int npevs)
-{
-	int ret;
-
-	ret = init_probe_symbol_maps(pevs->uprobes);
-	if (ret < 0)
-		return ret;
-
-	ret = convert_perf_probe_events(pevs, npevs);
-	if (ret == 0)
-		ret = apply_perf_probe_events(pevs, npevs);
-
-	cleanup_perf_probe_events(pevs, npevs);
-
-	exit_probe_symbol_maps();
-	return ret;
-}
-
 int del_perf_probe_events(struct strfilter *filter)
 {
 	int ret, ret2, ufd = -1, kfd = -1;
-- 
2.9.3

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

* Re: [PATCH 1/2] perf probe: Fix concat_probe_trace_events
  2017-03-08  6:59 [PATCH 1/2] perf probe: Fix concat_probe_trace_events Ravi Bangoria
  2017-03-08  6:59 ` [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events Ravi Bangoria
@ 2017-03-08  8:37 ` Masami Hiramatsu
  2017-03-20  9:33   ` Ravi Bangoria
  2017-03-21  6:53 ` [tip:perf/core] " tip-bot for Ravi Bangoria
  2 siblings, 1 reply; 8+ messages in thread
From: Masami Hiramatsu @ 2017-03-08  8:37 UTC (permalink / raw)
  To: Ravi Bangoria; +Cc: acme, peterz, mingo, alexander.shishkin, linux-kernel

On Wed,  8 Mar 2017 12:29:07 +0530
Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> wrote:

> '*ntevs' contains number of elements present in 'tevs' array. If
> there are no elements in array, 'tevs2' can be directly assigned
> to 'tevs' without allocating more space. So the condition should
> be  '*ntevs == 0'  not  'ntevs == 0'.

Oops, good catch!

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

> 
> Fixes: 42bba263eb58 ("perf probe: Allow wildcard for cached events")
> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
> ---
>  tools/perf/util/probe-event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 28fb62c..4f9d6ee 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -3057,7 +3057,7 @@ concat_probe_trace_events(struct probe_trace_event **tevs, int *ntevs,
>  	struct probe_trace_event *new_tevs;
>  	int ret = 0;
>  
> -	if (ntevs == 0) {
> +	if (*ntevs == 0) {
>  		*tevs = *tevs2;
>  		*ntevs = ntevs2;
>  		*tevs2 = NULL;
> -- 
> 2.9.3
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

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

* Re: [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events
  2017-03-08  6:59 ` [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events Ravi Bangoria
@ 2017-03-08  9:43   ` Masami Hiramatsu
  2017-03-08  9:58     ` Ravi Bangoria
  0 siblings, 1 reply; 8+ messages in thread
From: Masami Hiramatsu @ 2017-03-08  9:43 UTC (permalink / raw)
  To: Ravi Bangoria; +Cc: acme, peterz, mingo, alexander.shishkin, linux-kernel

On Wed,  8 Mar 2017 12:29:08 +0530
Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> wrote:

> I don't see any user of this function. This function was being copied
> to tools/perf/builtin-probe.c by commit b02137cc6550 ("perf probe: Move
> print logic into cmd_probe()"). Since then it has became stale.

Hmm, I have intended to keep it as an library API, which allows 
user to add event silently (e.g. adding sdt event in background).

Thanks,

> 
> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
> ---
>  tools/perf/util/probe-event.c | 18 ------------------
>  1 file changed, 18 deletions(-)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 4f9d6ee..9f18204 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -3361,24 +3361,6 @@ void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs)
>  	}
>  }
>  
> -int add_perf_probe_events(struct perf_probe_event *pevs, int npevs)
> -{
> -	int ret;
> -
> -	ret = init_probe_symbol_maps(pevs->uprobes);
> -	if (ret < 0)
> -		return ret;
> -
> -	ret = convert_perf_probe_events(pevs, npevs);
> -	if (ret == 0)
> -		ret = apply_perf_probe_events(pevs, npevs);
> -
> -	cleanup_perf_probe_events(pevs, npevs);
> -
> -	exit_probe_symbol_maps();
> -	return ret;
> -}
> -
>  int del_perf_probe_events(struct strfilter *filter)
>  {
>  	int ret, ret2, ufd = -1, kfd = -1;
> -- 
> 2.9.3
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

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

* Re: [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events
  2017-03-08  9:43   ` Masami Hiramatsu
@ 2017-03-08  9:58     ` Ravi Bangoria
  0 siblings, 0 replies; 8+ messages in thread
From: Ravi Bangoria @ 2017-03-08  9:58 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: acme, peterz, mingo, alexander.shishkin, linux-kernel, Ravi Bangoria

Thanks Masami for the review,

On Wednesday 08 March 2017 03:13 PM, Masami Hiramatsu wrote:
> On Wed,  8 Mar 2017 12:29:08 +0530
> Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> wrote:
>
>> I don't see any user of this function. This function was being copied
>> to tools/perf/builtin-probe.c by commit b02137cc6550 ("perf probe: Move
>> print logic into cmd_probe()"). Since then it has became stale.
> Hmm, I have intended to keep it as an library API, which allows 
> user to add event silently (e.g. adding sdt event in background).

Makes sense. Dropping it.

-Ravi

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

* Re: [PATCH 1/2] perf probe: Fix concat_probe_trace_events
  2017-03-08  8:37 ` [PATCH 1/2] perf probe: Fix concat_probe_trace_events Masami Hiramatsu
@ 2017-03-20  9:33   ` Ravi Bangoria
  2017-03-20 13:39     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 8+ messages in thread
From: Ravi Bangoria @ 2017-03-20  9:33 UTC (permalink / raw)
  To: acme
  Cc: Masami Hiramatsu, peterz, mingo, alexander.shishkin,
	linux-kernel, Ravi Bangoria



On Wednesday 08 March 2017 02:07 PM, Masami Hiramatsu wrote:
> On Wed,  8 Mar 2017 12:29:07 +0530
> Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> wrote:
>
>> '*ntevs' contains number of elements present in 'tevs' array. If
>> there are no elements in array, 'tevs2' can be directly assigned
>> to 'tevs' without allocating more space. So the condition should
>> be  '*ntevs == 0'  not  'ntevs == 0'.
> Oops, good catch!
>
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Hi Arnaldo,

Can you please pull this patch.

Thanks,
Ravi

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

* Re: [PATCH 1/2] perf probe: Fix concat_probe_trace_events
  2017-03-20  9:33   ` Ravi Bangoria
@ 2017-03-20 13:39     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 8+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-03-20 13:39 UTC (permalink / raw)
  To: Ravi Bangoria
  Cc: Masami Hiramatsu, peterz, mingo, alexander.shishkin, linux-kernel

Em Mon, Mar 20, 2017 at 03:03:05PM +0530, Ravi Bangoria escreveu:
> 
> 
> On Wednesday 08 March 2017 02:07 PM, Masami Hiramatsu wrote:
> > On Wed,  8 Mar 2017 12:29:07 +0530
> > Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> wrote:
> >
> >> '*ntevs' contains number of elements present in 'tevs' array. If
> >> there are no elements in array, 'tevs2' can be directly assigned
> >> to 'tevs' without allocating more space. So the condition should
> >> be  '*ntevs == 0'  not  'ntevs == 0'.
> > Oops, good catch!
> >
> > Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
> 
> Hi Arnaldo,
> 
> Can you please pull this patch.

Sure, done.

- Arnaldo

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

* [tip:perf/core] perf probe: Fix concat_probe_trace_events
  2017-03-08  6:59 [PATCH 1/2] perf probe: Fix concat_probe_trace_events Ravi Bangoria
  2017-03-08  6:59 ` [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events Ravi Bangoria
  2017-03-08  8:37 ` [PATCH 1/2] perf probe: Fix concat_probe_trace_events Masami Hiramatsu
@ 2017-03-21  6:53 ` tip-bot for Ravi Bangoria
  2 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Ravi Bangoria @ 2017-03-21  6:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, tglx, peterz, ravi.bangoria, mhiramat, alexander.shishkin,
	hpa, linux-kernel, mingo

Commit-ID:  f0a30dca5f84fe8048271799b56677ac2279de66
Gitweb:     http://git.kernel.org/tip/f0a30dca5f84fe8048271799b56677ac2279de66
Author:     Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
AuthorDate: Wed, 8 Mar 2017 12:29:07 +0530
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 20 Mar 2017 15:01:32 -0300

perf probe: Fix concat_probe_trace_events

'*ntevs' contains number of elements present in 'tevs' array. If there
are no elements in array, 'tevs2' can be directly assigned to 'tevs'
without allocating more space. So the condition should be  '*ntevs == 0'
not  'ntevs == 0'.

Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Fixes: 42bba263eb58 ("perf probe: Allow wildcard for cached events")
Link: http://lkml.kernel.org/r/20170308065908.4128-1-ravi.bangoria@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index b19d178..6740d68 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -3048,7 +3048,7 @@ concat_probe_trace_events(struct probe_trace_event **tevs, int *ntevs,
 	struct probe_trace_event *new_tevs;
 	int ret = 0;
 
-	if (ntevs == 0) {
+	if (*ntevs == 0) {
 		*tevs = *tevs2;
 		*ntevs = ntevs2;
 		*tevs2 = NULL;

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

end of thread, other threads:[~2017-03-21  7:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08  6:59 [PATCH 1/2] perf probe: Fix concat_probe_trace_events Ravi Bangoria
2017-03-08  6:59 ` [PATCH 2/2] perf probe: Remove stale func add_perf_probe_events Ravi Bangoria
2017-03-08  9:43   ` Masami Hiramatsu
2017-03-08  9:58     ` Ravi Bangoria
2017-03-08  8:37 ` [PATCH 1/2] perf probe: Fix concat_probe_trace_events Masami Hiramatsu
2017-03-20  9:33   ` Ravi Bangoria
2017-03-20 13:39     ` Arnaldo Carvalho de Melo
2017-03-21  6:53 ` [tip:perf/core] " tip-bot for Ravi Bangoria

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.