trinity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vince Weaver <vincent.weaver@maine.edu>
To: Dave Jones <davej@redhat.com>
Cc: trinity@vger.kernel.org
Subject: [patch] perf_event_open more likely tracepoint values
Date: Thu, 14 Nov 2013 12:35:27 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1311141230450.8746@vincent-weaver-1.um.maine.edu> (raw)


Tracepoint ids tend to be relatively small (less than 1024 or so).
This change makes it more likely to hit valid ones.

Once the fix to avoid the troublesome 0x18 (irq_work_exit)
tracepoint gets into the kernel maybe we can start stressing
things with trinity again.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>


diff --git a/syscalls/perf_event_open.c b/syscalls/perf_event_open.c
index 2ff004e..516172a 100644
--- a/syscalls/perf_event_open.c
+++ b/syscalls/perf_event_open.c
@@ -723,9 +723,20 @@ static long long random_event_config(__u32 *event_type,
 		break;
 	case PERF_TYPE_TRACEPOINT:
 		/* Actual values to use can be found under */
-		/* debugfs tracing/events// *//*/id        */
-		/* usually a small < 1024 number           */
-		config = rand64();
+		/* debugfs tracing/events/?*?/?*?/id       */
+		/* usually a small < 4096 number           */
+		switch(rand()%2) {
+		case 0:
+			/* Try a value < 4096 */
+			config = rand()&0xfff;
+			break;
+		case 1:
+			config = rand64();
+			break;
+		default:
+			config = rand64();
+			break;
+		}
 		break;
 	case PERF_TYPE_HW_CACHE:
 		config = random_cache_config();

             reply	other threads:[~2013-11-14 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 17:35 Vince Weaver [this message]
2013-11-14 17:33 ` [patch] perf_event_open more likely tracepoint values Dave Jones
2013-11-15 20:45   ` Vince Weaver

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=alpine.DEB.2.10.1311141230450.8746@vincent-weaver-1.um.maine.edu \
    --to=vincent.weaver@maine.edu \
    --cc=davej@redhat.com \
    --cc=trinity@vger.kernel.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 read-only IMAP folder(s) and NNTP newsgroup(s).