From: jp_ikaheimonen@mentor.com (JP Ikaheimonen)
Subject: [lttng-dev] [PATCH lttng-tools 06/28] Add exclusion matching logic to trace_ust_ht_match_event
Date: Thu, 7 Nov 2013 12:19:55 +0200 [thread overview]
Message-ID: <1383819595-6633-1-git-send-email-jp_ikaheimonen@mentor.com> (raw)
Signed-off-by: JP Ikaheimonen <jp_ikaheimonen at mentor.com>
---
src/bin/lttng-sessiond/trace-ust.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c
index b645975..c0fc3a0 100644
--- a/src/bin/lttng-sessiond/trace-ust.c
+++ b/src/bin/lttng-sessiond/trace-ust.c
@@ -75,7 +75,7 @@ int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key)
event = caa_container_of(node, struct ltt_ust_event, node.node);
key = _key;
- /* Match the 3 elements of the key: name, filter and loglevel. */
+ /* Match the 4 elements of the key: name, filter, loglevel, exclusions. */
/* Event name */
if (strncmp(event->attr.name, key->name, sizeof(event->attr.name)) != 0) {
@@ -111,6 +111,19 @@ int trace_ust_ht_match_event(struct cds_lfht_node *node, const void *_key)
}
}
+ /* If only one of the exclusions is NULL, fail. */
+ if ((key->exclusion && !event->exclusion) || (!key->exclusion && event->exclusion)) {
+ goto no_match;
+ }
+
+ if (key->exclusion && event->exclusion) {
+ /* Both exclusions exist; check count followed by names. */
+ if (event->exclusion->count != key->exclusion->count ||
+ memcmp(event->exclusion->names, key->exclusion->names,
+ event->exclusion->count * LTTNG_SYMBOL_NAME_LEN) != 0) {
+ goto no_match;
+ }
+ }
/* Match. */
return 1;
--
1.8.1.2
reply other threads:[~2013-11-07 10:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1383819595-6633-1-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