From: Yi Li <yi.li@analog.com>
To: jkacur@redhat.com
Cc: williams@redhat.com, tglx@linutronix.de,
linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org,
Yi Li <yi.li@analog.com>
Subject: [PATCH] cyclictest: set "tracing_thresh" optionally (resend)
Date: Thu, 28 Jan 2010 14:50:59 +0800 [thread overview]
Message-ID: <1264661459-16850-1-git-send-email-yi.li@analog.com> (raw)
Add an option "--tracing_thresh=THRESH" to set "tracing_thresh" of
current tracer, so it is not set to "tracelimit" by default.
Signed-off-by: Yi Li <yi.li@analog.com>
---
src/cyclictest/cyclictest.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index dc86b49..1d32ec4 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -146,6 +146,7 @@ struct thread_stat {
static int shutdown;
static int tracelimit = 0;
+static int tracing_thresh = 0;
static int ftrace = 0;
static int kernelversion;
static int verbose = 0;
@@ -387,8 +388,10 @@ static void setup_tracer(void)
char buffer[32];
int ret;
- sprintf(buffer, "%d", tracelimit);
- setkernvar("tracing_thresh", buffer);
+ if (tracing_thresh >= 0 && tracing_thresh <= tracelimit) {
+ sprintf(buffer, "%d", tracing_thresh);
+ setkernvar("tracing_thresh", buffer);
+ }
/* ftrace_enabled is a sysctl variable */
fileprefix = procfileprefix;
@@ -770,6 +773,7 @@ static void display_help(int error)
" without -t default = 1\n"
"-T TRACE --tracer=TRACER set tracing function\n"
" configured tracers: %s\n"
+ "--tracing_thresh=THRESH set tracing_thresh of current tracer to THRESH\n"
"-u --unbuffered force unbuffered output for live processing\n"
"-v --verbose output values on stdout for statistics\n"
" format: n:c:v n=tasknum c=count v=value in us\n"
@@ -903,6 +907,7 @@ static void process_options (int argc, char *argv[])
{"help", no_argument, NULL, '?'},
{"tracer", required_argument, NULL, 'T'},
{"traceopt", required_argument, NULL, 'O'},
+ {"tracing_thresh", required_argument, NULL, 1},
{"smp", no_argument, NULL, 'S'},
{"numa", no_argument, NULL, 'U'},
{NULL, 0, NULL, 0}
@@ -995,6 +1000,7 @@ static void process_options (int argc, char *argv[])
#endif
break;
case '?': display_help(0); break;
+ case 1: tracing_thresh = atoi(optarg); break;
}
}
--
1.6.0.4
reply other threads:[~2010-01-28 6:54 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=1264661459-16850-1-git-send-email-yi.li@analog.com \
--to=yi.li@analog.com \
--cc=jkacur@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.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).