Comments (5)
I'm a little hazy on the event types / categories and how to query them from sysfs. Does https://godoc.org/acln.ro/perf#LookupEventType give something for "hw_interrupts"? For dynamic selection of tracepoints, we have https://godoc.org/acln.ro/perf#LookupTracepointConfig, but maybe there is a more general interface to be found here.
from perf.
If it's just looking in /sys/bus/event_source/devices
, there is not a hw_interrupts
in that directory.
from perf.
Found it, it's defined here:
https://github.com/torvalds/linux/blob/3bfe1fc46794631366faa3ef075e1b0ff7ba120a/tools/perf/pmu-events/arch/x86/skylake/other.json#L43
Found it by doing perf list -v pmu
and then searching for the description, because it only appears as HW_INTERRUPTS
and I was grepping for only the lower case.
from perf.
Reading around a bit I think I want a PERF_EVENT_COUNT_RAW
:
If type is PERF_TYPE_RAW, then a custom "raw" config value is needed. Most CPUs support events that are not covered by the "generalized" events. These are implementation
defined; see your CPU manual (for example the Intel Volume 3B documentation or the AMD BIOS and Kernel Developer Guide). The libpfm4 library can be used to translate from
the name in the architectural manuals to the raw hex value perf_event_open() expects in this field.
from perf.
I was able to get this event by doing the following:
hwInt := includeKernel(&perf.Attr{
Label: "hw_interrupts.received",
Type: perf.RawEvent,
Config: 0x1CB,
})
func includeKernel(c perf.Configurator) perf.Configurator {
tpattr := new(perf.Attr)
c.Configure(tpattr)
tpattr.Options.ExcludeKernel = false
return tpattr
}
I figured this out with strace -f -eperf_event_open
. I figure that 0x1CB
is <UMask><EventCode>
from other.json linked above (and also appearing in the perf -v output
, in the body of this issue.
I'm going to call this issue closed. We could potentially open up a new issue to come up with a friendlier API for doing this, perhaps, but I'm unsure of the value of that at the moment.
from perf.
Related Issues (16)
- Tracepoint Configurator could be more clever
- Failing tests with -test.count=10 HOT 4
- Tests fail as user with paranoid=1 HOT 3
- Confusing code HOT 1
- Use Errorf instead of Fatalf in test failures where possible
- Samples# dramatically decreases if preciseIP is non-zero. HOT 1
- Missing events due to early return on perfhup
- EBADF in testComm HOT 6
- No way to specify PERF_FLAG_FD_OUTPUT (?) HOT 6
- Revisit testComm waiting on sawcommevfd
- Idea: perf.Command HOT 3
- The way forward for the perf package HOT 3
- (*perf.Group).Options are not respected after g.Add() HOT 3
- Is CallingThread correctly named? HOT 2
- Should perf.Tracepoint work as part of a group? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perf.