linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
	"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH v7 07/32] kernel-shark: Add stream_id to kshark_entry
Date: Fri, 11 Dec 2020 16:44:46 +0200	[thread overview]
Message-ID: <20201211144511.575346-8-y.karadz@gmail.com> (raw)
In-Reply-To: <20201211144511.575346-1-y.karadz@gmail.com>

kshark_entry contains all information from one trace record, needed
in order to visualize the time-series of trace records. Here we
reorganize the data fields of kshark_entry in order to make room for
the unique identifier of the Data stream this entry belongs to.

The Id is coded in 16 bits that are taken from the "event_id" field.
So far "event_id" uses 32 bits but we found that it is coded with only
16 bits inside the kernel, so we still have 16 unused (spare) bits in
it.

Because the stream Id is coded with int8_t, we need to set an upper
limit (127) for the total number of Data streams loaded.

Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/libkshark.h | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/libkshark.h b/src/libkshark.h
index 9eecc2d..7d8b53b 100644
--- a/src/libkshark.h
+++ b/src/libkshark.h
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1 */
 
 /*
- * Copyright (C) 2017 VMware Inc, Yordan Karadzhov <y.karadz@gmail.com>
+ * Copyright (C) 2017 VMware Inc, Yordan Karadzhov (VMware) <y.karadz@gmail.com>
  */
 
  /**
@@ -51,15 +51,18 @@ struct kshark_entry {
 	 */
 	uint16_t	visible;
 
+	/** Data stream identifier. */
+	int16_t		stream_id;
+
+	/** Unique Id of the trace event type. */
+	int16_t		event_id;
+
 	/** The CPU core of the record. */
 	int16_t		cpu;
 
 	/** The PID of the task the record was generated. */
 	int32_t		pid;
 
-	/** Unique Id ot the trace event type. */
-	int32_t		event_id;
-
 	/** The offset into the trace file, used to find the record. */
 	int64_t		offset;
 
-- 
2.25.1


  parent reply	other threads:[~2020-12-11 15:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-11 14:44 [PATCH v7 00/32] Start KernelShark v2 transformation Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 01/32] kernel-shark: Add license information Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 02/32] kernel-shark: Change the CMake minimum version required Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 03/32] kernel-shark: Use libtraceevent and libtracefs Yordan Karadzhov (VMware)
2020-12-11 19:38   ` Steven Rostedt
2020-12-11 14:44 ` [PATCH v7 04/32] kernel-shark: Update README Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 05/32] kernel-shark: Define build target for JSONC Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 06/32] kernel-shark: Use only signed types in kshark_entry Yordan Karadzhov (VMware)
2020-12-11 14:44 ` Yordan Karadzhov (VMware) [this message]
2020-12-11 14:44 ` [PATCH v7 08/32] kernel-shark: Introduce libkshark-hash Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 09/32] kernel-shark: Introduce Data streams Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 10/32] kernel-shark: Rename static methods in libkshark Yordan Karadzhov (VMware)
2020-12-11 14:44 ` [PATCH v7 11/32] kernel-shark: Add basic methods for Data streams Yordan Karadzhov (VMware)
2020-12-11 15:07 [PATCH v7 00/32] Start KernelShark v2 transformation Yordan Karadzhov (VMware)
2020-12-11 15:07 ` [PATCH v7 07/32] kernel-shark: Add stream_id to kshark_entry Yordan Karadzhov (VMware)

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=20201211144511.575346-8-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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).