diff options
author | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2011-11-25 14:03:05 -0500 |
---|---|---|
committer | Robert Richter <robert.richter@amd.com> | 2011-12-07 05:47:09 -0500 |
commit | dd3c4670d7fafeb18bf7542fbcfd2606fb06a4a1 (patch) | |
tree | 14258ccf4645c774bd0f765c9ec957fd0c5742ce /arch/s390/oprofile/op_counter.h | |
parent | f8c852031a383ac260ae37df7ad063d42d0ed271 (diff) |
oprofile, s390: Add event interface to the System z hardware sampling module
With this patch the OProfile Basic Mode Sampling support for System z
is enhanced with a counter file system. That way hardware sampling
can be configured using the user space tools with only little
modifications.
With the patch by default new cpu_types (s390/z10, s390/z196) are
returned in order to indicate that we are running a CPU which provides
the hardware sampling facility. Existing user space tools will
complain about an unknown cpu type. In order to be compatible with
existing user space tools the `cpu_type' module parameter has been
added. Setting the parameter to `timer' will force the module to
return `timer' as cpu_type. The module will still try to use hardware
sampling if available and the hwsampling virtual filesystem will be
also be available for configuration. So this has a different effect
than using the generic oprofile module parameter `timer=1'.
If the basic mode sampling is enabled on the machine and the
cpu_type=timer parameter is not used the kernel module will provide
the following virtual filesystem:
/dev/oprofile/0/enabled
/dev/oprofile/0/event
/dev/oprofile/0/count
/dev/oprofile/0/unit_mask
/dev/oprofile/0/kernel
/dev/oprofile/0/user
In the counter file system only the values of 'enabled', 'count',
'kernel', and 'user' are evaluated by the kernel module. Everything
else must contain fixed values.
The 'event' value only supports a single event - HWSAMPLING with value
0.
The 'count' value specifies the hardware sampling rate as it is passed
to the CPU measurement facility.
The 'kernel' and 'user' flags can now be used to filter for samples
when using hardware sampling.
Additionally also the following file will be created:
/dev/oprofile/timer/enabled
This will always be the inverted value of /dev/oprofile/0/enabled. 0
is not accepted without hardware sampling.
Signed-off-by: Andreas Krebbel <krebbel@linux.vnet.ibm.com>
Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/s390/oprofile/op_counter.h')
-rw-r--r-- | arch/s390/oprofile/op_counter.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/s390/oprofile/op_counter.h b/arch/s390/oprofile/op_counter.h new file mode 100644 index 000000000000..1a8d3ca09014 --- /dev/null +++ b/arch/s390/oprofile/op_counter.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /** | ||
2 | * arch/s390/oprofile/op_counter.h | ||
3 | * | ||
4 | * Copyright (C) 2011 IBM Deutschland Entwicklung GmbH, IBM Corporation | ||
5 | * Author(s): Andreas Krebbel (krebbel@linux.vnet.ibm.com) | ||
6 | * | ||
7 | * @remark Copyright 2011 OProfile authors | ||
8 | */ | ||
9 | |||
10 | #ifndef OP_COUNTER_H | ||
11 | #define OP_COUNTER_H | ||
12 | |||
13 | struct op_counter_config { | ||
14 | /* `enabled' maps to the hwsampler_file variable. */ | ||
15 | /* `count' maps to the oprofile_hw_interval variable. */ | ||
16 | /* `event' and `unit_mask' are unused. */ | ||
17 | unsigned long kernel; | ||
18 | unsigned long user; | ||
19 | }; | ||
20 | |||
21 | extern struct op_counter_config counter_config; | ||
22 | |||
23 | #endif /* OP_COUNTER_H */ | ||