This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH] Re: Inserting delays with systemtap
On 03/08/2012 05:17 PM, Bryn M. Reeves wrote:
> I've attached a patch that adds the guru_delay.stp patchset - I also
> included a wrapper around udelay() in case anyone has a use for that
> (it's too fine a granularity for my application but I can see other
> instances where it could be useful).
Here's one with less silly typos in it. Shouldn't try to finish patches
while meetings are still running..
Bryn.
>From c64762a11e41848e894b965cb99094886198b73d Mon Sep 17 00:00:00 2001
From: "Bryn M. Reeves" <bmr@redhat.com>
Date: Thu, 8 Mar 2012 17:41:17 +0000
Subject: [PATCH] Add guru_delay.stp to tapset
Adds systemtap mdelay(ms) and udelay(us) functions for inserting
programmable delays at probe sites.
---
tapset/guru-delay.stp | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
create mode 100644 tapset/guru-delay.stp
diff --git a/tapset/guru-delay.stp b/tapset/guru-delay.stp
new file mode 100644
index 0000000..f66a024
--- /dev/null
+++ b/tapset/guru-delay.stp
@@ -0,0 +1,28 @@
+// Copyright (C) 2102 Red Hat Inc., Bryn M. Reeves <bmr@redhat.com>
+//
+// This file is part of systemtap, and is free software. You can
+// redistribute it and/or modify it under the terms of the GNU General
+// Public License (GPL); either version 2, or (at your option) any
+// later version.
+//
+
+// <tapsetdescription>
+// Programmable delays at probe sites
+// </tapsetdescription>
+
+%{
+/* guru */
+#undef STP_OVERLOAD
+#include <linux/delay.h>
+%}
+
+function mdelay(ms:long) %{
+ /* guru */
+ mdelay(THIS->ms);
+%}
+
+function udelay(us:long) %{
+ /* guru */
+ udelay(THIS->us);
+%}
+
--
1.7.6.5