From: "Wink Saville" <wink@saville.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 1/7] Documention for trace record (trec), a light weight tracing mechanism
Date: Tue, 20 Mar 2007 23:46:31 -0700 [thread overview]
Message-ID: <d4cf37a60703202346n27ede1b4k60d2ad75e7c8b4c2@mail.gmail.com> (raw)
Signed-off-by: Wink Saville <wink@saville.com>
---
Documentation/trec.txt | 87 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 87 insertions(+), 0 deletions(-)
create mode 100644 Documentation/trec.txt
diff --git a/Documentation/trec.txt b/Documentation/trec.txt
new file mode 100644
index 0000000..e12a552
--- /dev/null
+++ b/Documentation/trec.txt
@@ -0,0 +1,87 @@
+Title : Trace Records
+Authors : Wink Saville <wink@saville.com>
+
+CONTENTS
+
+1. Concepts
+2. Architectures Supported
+3. Configuring
+4. API Reference
+5. Overhead
+6. TODO
+
+
+1. Concepts
+
+Trace records are a light weight tracing technique that time stamps
+small amounts of information and stores them in a buffer. TREC's are
+light enough that they may be sprinkled most anywhere in the kernel
+and have very little performance impact.
+
+For instance they can be placed in the scheduler and ISR's to watch
+the interaction between ISR's and the scheduler. They can be placed
+in memory handling routines to determine how and when memory is
+allocated and freed.
+
+In the current default configuration the trec's are dumped by calling
+trec_print_snapshot when die() or panic() are called as well as when
+the kernel itself page faults in do_page_fault.
+
+
+2. Architectures Supported
+
+Should support all architectures has been tested only on:
+
+- X86_64
+
+
+3. Configuring
+
+Since trec's are implemented as a device driver they are configured
+by enabling support in the "Device Drivers" section of as they could
+be used early being a module is not supported.
+
+
+4. API Reference
+
+Trec supports the following API:
+
+void trec_init(void):
+
+ Initialize the module, this may be called before the driver is loaded
+ if it is desired to use trec's early.
+
+void trec_write(unsigned long pc, int pid, unsigned long v1, unsigned long v2);
+
+ This is the routine used to write into the buffer. pc is the program counter
+ pid is the process id and v1 and v2 are two parameters.
+
+void trec_snapshot(void);
+
+ Calling this function takes a snapshot of the current trec buffer so that it
+ will not be modified. This is called prior to printing the snapshot via
+ trec_print_snapshot.
+
+void trec_print_snapshot(void);
+
+ Print the snapshot.
+
+In addition a set of macros are defined for convience, they come in
+two flavors, TRECxxx and ZRECxxx. The TRECxxx macros invoke trec_write
+and the ZRECxxx macros do nothing allowing the macros to be quicly
+disabled. Look at include/linux/trec.h for the current set of macros.
+
+
+5. Overhead
+
+Measured on a 2.4GHZ Core 2 Duo the readings between two TREC's is
+270 tics of the rdtsc or about 0.1us. No attempt has been made to
+optimize and less information can be collected if the overhead
+is still to high.
+
+
+6. TODO
+
+a. Add code to dump trec to user space
+b. Enhance to allow runtime registration and runtime enable disable.
+
--
1.5.0.rc2
reply other threads:[~2007-03-21 6:46 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=d4cf37a60703202346n27ede1b4k60d2ad75e7c8b4c2@mail.gmail.com \
--to=wink@saville.com \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®