linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org, y.karadz@gmail.com
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files
Date: Wed, 10 Mar 2021 14:11:35 +0200	[thread overview]
Message-ID: <20210310121135.1620453-1-tz.stoyanov@gmail.com> (raw)

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


             reply	other threads:[~2021-03-10 12:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 12:11 Tzvetomir Stoyanov (VMware) [this message]
2021-03-10 21:48 ` [PATCH] kernel-shark v2: Change the logic for opening trace-cmd files Steven Rostedt
2021-03-11 14:15   ` Yordan Karadzhov (VMware)
2021-03-11 14:55     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210310121135.1620453-1-tz.stoyanov@gmail.com \
    --to=tz.stoyanov@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=y.karadz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).