diff options
author | Robert Richter <robert.richter@amd.com> | 2008-12-25 11:26:07 -0500 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2009-01-07 16:40:47 -0500 |
commit | ae735e9964b4584923f2997d98a8d80ae9c1a75c (patch) | |
tree | 0fc72d18bcc5951f9dd519e8a4527593724b816f /arch/x86 | |
parent | 2d87b14cf8d0b07720de26d90789d02124141616 (diff) |
oprofile: rework implementation of cpu buffer events
Special events such as task or context switches are marked with an
escape code in the cpu buffer followed by an event code or a task
identifier. There is one escape code per event. To make escape
sequences also available for data samples the internal cpu buffer
format must be changed. The current implementation does not allow the
extension of event codes since this would lead to collisions with the
task identifiers. To avoid this, this patch introduces an event mask
that allows the storage of multiple events with one escape code. Now,
task identifiers are stored in the data section of the sample. The
implementation also allows the usage of custom data in a sample. As a
side effect the new code is much more readable and easier to
understand.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/oprofile/op_model_amd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c index 423a95438cbc..f101724db80a 100644 --- a/arch/x86/oprofile/op_model_amd.c +++ b/arch/x86/oprofile/op_model_amd.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * @file op_model_amd.c | 2 | * @file op_model_amd.c |
3 | * athlon / K7 / K8 / Family 10h model-specific MSR operations | 3 | * athlon / K7 / K8 / Family 10h model-specific MSR operations |
4 | * | 4 | * |
5 | * @remark Copyright 2002-2008 OProfile authors | 5 | * @remark Copyright 2002-2009 OProfile authors |
6 | * @remark Read the file COPYING | 6 | * @remark Read the file COPYING |
7 | * | 7 | * |
8 | * @author John Levon | 8 | * @author John Levon |
@@ -10,7 +10,7 @@ | |||
10 | * @author Graydon Hoare | 10 | * @author Graydon Hoare |
11 | * @author Robert Richter <robert.richter@amd.com> | 11 | * @author Robert Richter <robert.richter@amd.com> |
12 | * @author Barry Kasindorf | 12 | * @author Barry Kasindorf |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/oprofile.h> | 15 | #include <linux/oprofile.h> |
16 | #include <linux/device.h> | 16 | #include <linux/device.h> |
@@ -62,8 +62,8 @@ static unsigned long reset_value[NUM_COUNTERS]; | |||
62 | 62 | ||
63 | /* Codes used in cpu_buffer.c */ | 63 | /* Codes used in cpu_buffer.c */ |
64 | /* This produces duplicate code, need to be fixed */ | 64 | /* This produces duplicate code, need to be fixed */ |
65 | #define IBS_FETCH_BEGIN 3 | 65 | #define IBS_FETCH_BEGIN (1UL << 4) |
66 | #define IBS_OP_BEGIN 4 | 66 | #define IBS_OP_BEGIN (1UL << 5) |
67 | 67 | ||
68 | /* | 68 | /* |
69 | * The function interface needs to be fixed, something like add | 69 | * The function interface needs to be fixed, something like add |