From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [ltt-dev] [RFC] New UST 2.0 Tracepoint Event API : TRACEPOINT_FORMAT
Date: Wed, 31 Aug 2011 12:36:39 -0400 [thread overview]
Message-ID: <20110831163639.GA12439@Krystal> (raw)
Hi,
I've been informed that support for a per-tracepoint format string would
be welcomed by many. I would prefer not to make formats strings a
requirement, but rather an optional feature. I am considering the
following API:
TRACEPOINT_FORMAT(tracepoint_name,
"text describing a format string with args like %s and also %d",
fieldname_1, fieldname_2)
where fieldname_* refer to the name of the fields declared in the
tracepoint (NOT the tracepoint arguments!).
e.g.
TRACEPOINT_EVENT(ust_tests_hello_tptest,
TP_PROTO(int anint, long along, char *text)
TP_ARGS(anint, along, text)
TP_FIELDS(
ctf_integer(int, intfield, anint)
ctf_integer(long, longfield, along)
ctf_string(stringfield, text)
)
)
TRACEPOINT_FORMAT(tracepoint_name,
"some message %d and more %s",
intfield, stringfield)
Having some level of automated compiler-level type checking for the
format string in there might be a nice to have, but might be rather
tricky, and could change the API slightly as I proceed to the
implementation.
Thoughts ?
Thanks,
Mathieu
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
next reply other threads:[~2011-08-31 16:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-31 16:36 Mathieu Desnoyers [this message]
2011-09-01 14:25 ` Cruickshank, Brian
2011-09-01 17:33 ` Mathieu Desnoyers
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=20110831163639.GA12439@Krystal \
--to=mathieu.desnoyers@efficios.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