linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files
@ 2021-03-10 12:11 Tzvetomir Stoyanov (VMware)
  2021-03-10 21:48 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Tzvetomir Stoyanov (VMware) @ 2021-03-10 12:11 UTC (permalink / raw)
  To: rostedt, y.karadz; +Cc: linux-trace-devel

From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>

The logic for opening a trace file by trace-cmd library has changed.
Any timestamp corrections, found in the trace file metadata are applied
automatically. The old APIs, used by KernelShark for pairing trace files
from the same host-guest traceing session and adjusting timestamps are
now obsolete and should not be used.

Signed-off-by: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
---
 src/libkshark-tepdata.c | 49 -----------------------------------------
 1 file changed, 49 deletions(-)

diff --git a/src/libkshark-tepdata.c b/src/libkshark-tepdata.c
index d29e98b..4e76ef2 100644
--- a/src/libkshark-tepdata.c
+++ b/src/libkshark-tepdata.c
@@ -1206,49 +1206,6 @@ static void kshark_tep_init_methods(struct kshark_generic_stream_interface *inte
 	interface->load_matrix = tepdata_load_matrix;
 }
 
-/** Find a host stream from the same tracing session, that has guest information */
-static struct tracecmd_input *
-kshark_tep_find_merge_peer(struct kshark_context *kshark_ctx,
-			   struct tracecmd_input *handle)
-{
-	struct tracecmd_input *peer_handle = NULL;
-	struct kshark_data_stream *peer_stream;
-	unsigned long long trace_id;
-	int *stream_ids = NULL;
-	int ret;
-	int i;
-
-	trace_id = tracecmd_get_traceid(handle);
-	if (!trace_id)
-		goto out;
-
-	stream_ids = kshark_all_streams(kshark_ctx);
-	if (!stream_ids)
-		goto out;
-
-	for (i = 0; i < kshark_ctx->n_streams - 1; i++) {
-		peer_stream = kshark_get_data_stream(kshark_ctx, stream_ids[i]);
-		if (!peer_stream || !kshark_is_tep(peer_stream))
-			continue;
-
-		peer_handle = kshark_get_tep_input(peer_stream);
-		if (!peer_handle)
-			continue;
-
-		ret = tracecmd_get_guest_cpumap(peer_handle, trace_id,
-						NULL, NULL, NULL);
-		if (!ret)
-			break;
-	}
-
-	if (i == kshark_ctx->n_streams)
-		peer_handle = NULL;
-
-out:
-	free(stream_ids);
-	return peer_handle;
-}
-
 /** A list of built in default plugins for FTRACE (trace-cmd) data. */
 const char *tep_plugin_names[] = {
 	"sched_events",
@@ -1574,7 +1531,6 @@ bool kshark_tep_check_data(const char *file_name)
 int kshark_tep_init_input(struct kshark_data_stream *stream)
 {
 	struct kshark_context *kshark_ctx = NULL;
-	struct tracecmd_input *merge_peer;
 	struct tracecmd_input *input;
 
 	if (!kshark_instance(&kshark_ctx) || !init_thread_seq())
@@ -1591,11 +1547,6 @@ int kshark_tep_init_input(struct kshark_data_stream *stream)
 	if (!input)
 		return -EEXIST;
 
-	/* Find a merge peer from the same tracing session. */
-	merge_peer = kshark_tep_find_merge_peer(kshark_ctx, input);
-	if (merge_peer)
-		tracecmd_pair_peer(input, merge_peer);
-
 	/* Read the tracing data from the file. */
 	if (tracecmd_init_data(input) < 0)
 		goto fail;
-- 
2.29.2


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

* Re: [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files
  2021-03-10 12:11 [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files Tzvetomir Stoyanov (VMware)
@ 2021-03-10 21:48 ` Steven Rostedt
  2021-03-11 14:15   ` Yordan Karadzhov (VMware)
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2021-03-10 21:48 UTC (permalink / raw)
  To: Tzvetomir Stoyanov (VMware); +Cc: y.karadz, linux-trace-devel

On Wed, 10 Mar 2021 14:11:35 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
> 
> The logic for opening a trace file by trace-cmd library has changed.
> Any timestamp corrections, found in the trace file metadata are applied
> automatically. The old APIs, used by KernelShark for pairing trace files
> from the same host-guest traceing session and adjusting timestamps are

 s/traceing/tracing/

> now obsolete and should not be used.
> 
> Signed-off-by: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>

The from and SOB should be Tzvetomir Stoyanov (VMware), unless you changed
your middle name to (VMware) ;-)

As for the rest of the patch.

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

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

* Re: [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files
  2021-03-10 21:48 ` Steven Rostedt
@ 2021-03-11 14:15   ` Yordan Karadzhov (VMware)
  2021-03-11 14:55     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-03-11 14:15 UTC (permalink / raw)
  To: Steven Rostedt, Tzvetomir Stoyanov (VMware); +Cc: linux-trace-devel



On 10.03.21 г. 23:48, Steven Rostedt wrote:
> On Wed, 10 Mar 2021 14:11:35 +0200
> "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:
> 
>> From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
>>
>> The logic for opening a trace file by trace-cmd library has changed.
>> Any timestamp corrections, found in the trace file metadata are applied
>> automatically. The old APIs, used by KernelShark for pairing trace files
>> from the same host-guest traceing session and adjusting timestamps are
> 
>   s/traceing/tracing/
> 
>> now obsolete and should not be used.
>>
>> Signed-off-by: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>
> 
> The from and SOB should be Tzvetomir Stoyanov (VMware), unless you changed
> your middle name to (VMware) ;-)
> 
> As for the rest of the patch.
> 
> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

Hi Steven,

Thanks a lot for the review!

Have you tested that this works with the Timestamp synchronization 
patches that are not upstreamed yet?

Thanks!
Yordan


> 
> -- Steve
> 

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

* Re: [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files
  2021-03-11 14:15   ` Yordan Karadzhov (VMware)
@ 2021-03-11 14:55     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2021-03-11 14:55 UTC (permalink / raw)
  To: Yordan Karadzhov (VMware); +Cc: Tzvetomir Stoyanov (VMware), linux-trace-devel

On Thu, 11 Mar 2021 16:15:59 +0200
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:

> Have you tested that this works with the Timestamp synchronization 
> patches that are not upstreamed yet?

I was in the process of doing so, but haven't done it yet :-/

Will do today.

-- Steve

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

end of thread, other threads:[~2021-03-11 14:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 12:11 [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files Tzvetomir Stoyanov (VMware)
2021-03-10 21:48 ` Steven Rostedt
2021-03-11 14:15   ` Yordan Karadzhov (VMware)
2021-03-11 14:55     ` Steven Rostedt

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).