Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: jp_ikaheimonen@mentor.com (JP Ikaheimonen)
Subject: [lttng-dev] [PATCH lttng-tools 28/28] When listing events, show exclusions if they exist
Date: Thu,  7 Nov 2013 12:22:07 +0200	[thread overview]
Message-ID: <1383819727-6843-9-git-send-email-jp_ikaheimonen@mentor.com> (raw)
In-Reply-To: <1383819727-6843-1-git-send-email-jp_ikaheimonen@mentor.com>

Add "[has exclusions]" to the printout of an event, if that
event has exclusions added.

Signed-off-by: JP Ikaheimonen <jp_ikaheimonen at mentor.com>
---
 include/lttng/lttng.h         |  3 ++-
 src/bin/lttng-sessiond/cmd.c  |  3 +++
 src/bin/lttng/commands/list.c | 15 +++++++++++++--
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/include/lttng/lttng.h b/include/lttng/lttng.h
index 255f7c4..85fdfaa 100644
--- a/include/lttng/lttng.h
+++ b/include/lttng/lttng.h
@@ -226,7 +226,7 @@ struct lttng_event_function_attr {
  *
  * The structures should be initialized to zero before use.
  */
-#define LTTNG_EVENT_PADDING1               15
+#define LTTNG_EVENT_PADDING1               14
 #define LTTNG_EVENT_PADDING2               LTTNG_SYMBOL_NAME_LEN + 32
 struct lttng_event {
 	enum lttng_event_type type;
@@ -238,6 +238,7 @@ struct lttng_event {
 	int32_t enabled;	/* Does not apply: -1 */
 	pid_t pid;
 	unsigned char filter;	/* filter enabled ? */
+	unsigned char exclusion; /* exclusions added ? */
 
 	char padding[LTTNG_EVENT_PADDING1];
 
diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
index 69dfda6..d00bf1e 100644
--- a/src/bin/lttng-sessiond/cmd.c
+++ b/src/bin/lttng-sessiond/cmd.c
@@ -305,6 +305,9 @@ static int list_lttng_ust_global_events(char *channel_name,
 		if (uevent->filter) {
 			tmp[i].filter = 1;
 		}
+		if (uevent->exclusion) {
+			tmp[i].exclusion = 1;
+		}
 		i++;
 	}
 
diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c
index bca06e7..6a54279 100644
--- a/src/bin/lttng/commands/list.c
+++ b/src/bin/lttng/commands/list.c
@@ -168,6 +168,15 @@ const char *filter_string(int value)
 	}
 }
 
+static
+const char *exclusion_string(int value)
+{
+	switch (value) {
+	case 1: return " [has exclusions]";
+	default: return "";
+	}
+}
+
 static const char *loglevel_string(int value)
 {
 	switch (value) {
@@ -217,18 +226,20 @@ static void print_events(struct lttng_event *event)
 	case LTTNG_EVENT_TRACEPOINT:
 	{
 		if (event->loglevel != -1) {
-			MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s",
+			MSG("%s%s (loglevel: %s (%d)) (type: tracepoint)%s%s%s",
 				indent6,
 				event->name,
 				loglevel_string(event->loglevel),
 				event->loglevel,
 				enabled_string(event->enabled),
+				exclusion_string(event->exclusion),
 				filter_string(event->filter));
 		} else {
-			MSG("%s%s (type: tracepoint)%s%s",
+			MSG("%s%s (type: tracepoint)%s%s%s",
 				indent6,
 				event->name,
 				enabled_string(event->enabled),
+				exclusion_string(event->exclusion),
 				filter_string(event->filter));
 		}
 		break;
-- 
1.8.1.2




      parent reply	other threads:[~2013-11-07 10:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07 10:21 [lttng-dev] [PATCH lttng-tools 20/28] Send enable-event commands with exclusion data JP Ikaheimonen
2013-11-07 10:22 ` [lttng-dev] [PATCH lttng-tools 21/28] Collate lttng_enable_event* code JP Ikaheimonen
2013-11-07 10:22 ` [lttng-dev] [PATCH lttng-tools 22/28] Add -exclude option to enable-event command JP Ikaheimonen
2013-11-07 10:22 ` [lttng-dev] [PATCH lttng-tools 23/28] Add usage for --exclude option JP Ikaheimonen
2013-11-07 10:22 ` [lttng-dev] [PATCH lttng-tools 24/28] Add a function to check for legal exclusions JP Ikaheimonen
2013-11-07 10:22 ` [lttng-dev] [PATCH lttng-tools 25/28] Parse exclusions and forward them to the control handler JP Ikaheimonen
2013-11-07 10:22 ` [lttng-dev] [PATCH lttng-tools 26/28] Detect and report exclusion option errors JP Ikaheimonen
2013-11-07 10:22 ` [lttng-dev] [PATCH lttng-tools 27/28] Add exclusion names to diagnostic printouts JP Ikaheimonen
2013-11-07 10:22 ` JP Ikaheimonen [this message]

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=1383819727-6843-9-git-send-email-jp_ikaheimonen@mentor.com \
    --to=jp_ikaheimonen@mentor.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