From: Karim Yaghmour <karim@opersys.com>
To: Andrea Arcangeli <andrea@suse.de>,
Richard J Moore <richardj_moore@uk.ibm.com>,
John Levon <movement@marcelothewonderpenguin.com>,
Andrew Morton <akpm@zip.com.au>, bob <bob@watson.ibm.com>,
linux-kernel@vger.kernel.org,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
mjbligh@linux.ibm.com, John Levon <moz@compsoc.man.ac.uk>,
Rik van Riel <riel@conectiva.com.br>,
Linus Torvalds <torvalds@transmeta.com>
Subject: Re: Enhanced profiling support (was Re: vm lock contention reduction)
Date: Thu, 11 Jul 2002 00:59:40 -0400 [thread overview]
Message-ID: <3D2D10BC.B9DC2165@opersys.com> (raw)
In-Reply-To: <3D2D0DE0.F9D75703@opersys.com>
[-- Attachment #1: Type: text/plain, Size: 252 bytes --]
Sorry, the attachment never made it ...
===================================================
Karim Yaghmour
karim@opersys.com
Embedded and Real-Time Linux Expert
===================================================
[-- Attachment #2: example.c --]
[-- Type: text/plain, Size: 2325 bytes --]
/* Example usage of custom event API */
#define MODULE
#if 0
#define CONFIG_TRACE
#endif
#include <linux/config.h>
#include <linux/module.h>
#include <linux/trace.h>
#include <asm/string.h>
struct delta_event
{
int an_int;
char a_char;
};
static int alpha_id, omega_id, theta_id, delta_id, rho_id;
int init_module(void)
{
uint8_t a_byte;
char a_char;
int an_int;
int a_hex;
char* a_string = "We are initializing the module";
struct delta_event a_delta_event;
/* Create events */
alpha_id = trace_create_event("Alpha",
"Number %d, String %s, Hex %08X",
CUSTOM_EVENT_FORMAT_TYPE_STR,
NULL);
omega_id = trace_create_event("Omega",
"Number %d, Char %c",
CUSTOM_EVENT_FORMAT_TYPE_STR,
NULL);
theta_id = trace_create_event("Theta",
"Plain string",
CUSTOM_EVENT_FORMAT_TYPE_STR,
NULL);
delta_id = trace_create_event("Delta",
NULL,
CUSTOM_EVENT_FORMAT_TYPE_HEX,
NULL);
rho_id = trace_create_event("Rho",
NULL,
CUSTOM_EVENT_FORMAT_TYPE_HEX,
NULL);
/* Trace events */
an_int = 1;
a_hex = 0xFFFFAAAA;
trace_std_formatted_event(alpha_id, an_int, a_string, a_hex);
an_int = 25;
a_char = 'c';
trace_std_formatted_event(omega_id, an_int, a_char);
trace_std_formatted_event(theta_id);
memset(&a_delta_event, 0, sizeof(a_delta_event));
trace_raw_event(delta_id, sizeof(a_delta_event), &a_delta_event);
a_byte = 0x12;
trace_raw_event(rho_id, sizeof(a_byte), &a_byte);
return 0;
}
void cleanup_module(void)
{
uint8_t a_byte;
char a_char;
int an_int;
int a_hex;
char* a_string = "We are initializing the module";
struct delta_event a_delta_event;
/* Trace events */
an_int = 324;
a_hex = 0xABCDEF10;
trace_std_formatted_event(alpha_id, an_int, a_string, a_hex);
an_int = 789;
a_char = 's';
trace_std_formatted_event(omega_id, an_int, a_char);
trace_std_formatted_event(theta_id);
memset(&a_delta_event, 0xFF, sizeof(a_delta_event));
trace_raw_event(delta_id, sizeof(a_delta_event), &a_delta_event);
a_byte = 0xA4;
trace_raw_event(rho_id, sizeof(a_byte), &a_byte);
/* Destroy the events created */
trace_destroy_event(alpha_id);
trace_destroy_event(omega_id);
trace_destroy_event(theta_id);
trace_destroy_event(delta_id);
trace_destroy_event(rho_id);
}
next prev parent reply other threads:[~2002-07-11 4:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-10 14:28 Richard J Moore
2002-07-10 20:30 ` Karim Yaghmour
2002-07-10 21:41 ` Andrea Arcangeli
2002-07-11 4:47 ` Karim Yaghmour
2002-07-11 4:59 ` Karim Yaghmour [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-07-07 2:50 vm lock contention reduction Andrew Morton
2002-07-07 3:05 ` Linus Torvalds
2002-07-07 3:47 ` Andrew Morton
2002-07-08 11:39 ` Enhanced profiling support (was Re: vm lock contention reduction) John Levon
2002-07-08 17:52 ` Linus Torvalds
2002-07-08 18:41 ` Karim Yaghmour
2002-07-10 2:22 ` John Levon
2002-07-10 4:16 ` Karim Yaghmour
2002-07-10 4:38 ` John Levon
2002-07-10 5:46 ` Karim Yaghmour
2002-07-10 13:10 ` bob
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=3D2D10BC.B9DC2165@opersys.com \
--to=karim@opersys.com \
--cc=akpm@zip.com.au \
--cc=andrea@suse.de \
--cc=bob@watson.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mjbligh@linux.ibm.com \
--cc=movement@marcelothewonderpenguin.com \
--cc=moz@compsoc.man.ac.uk \
--cc=richardj_moore@uk.ibm.com \
--cc=riel@conectiva.com.br \
--cc=torvalds@transmeta.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