Skip to content

Commit 814ee09

Browse files
committed
Move LinuxTracepoints to src/native/external
1 parent d448d10 commit 814ee09

File tree

118 files changed

+22103
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+22103
-36
lines changed

src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,6 @@ if(FEATURE_PERFTRACING)
178178
if(CLR_CMAKE_TARGET_LINUX)
179179
list(APPEND CORECLR_LIBRARIES
180180
usereventsprovider
181-
tracepoint
182-
eventheader-tracepoint
183181
)
184182
endif(CLR_CMAKE_TARGET_LINUX)
185183
endif(FEATURE_PERFTRACING)

src/coreclr/vm/eventing/userevents/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ if (NOT GEN_USEREVENTS_RESULT EQUAL 0)
1414
message(FATAL_ERROR "Failed to generate user_events provider: ${GEN_USEREVENTS_ERRORS}")
1515
endif()
1616

17-
add_subdirectory(LinuxTracepoints)
18-
19-
include_directories(LinuxTracepoints/libtracepoint/include)
20-
include_directories(LinuxTracepoints/libeventheader-tracepoint/include)
17+
include(${CLR_SRC_NATIVE_DIR}/external/LinuxTracepoints.cmake)
2118

2219
add_definitions(-DPAL_STDCPP_COMPAT=1)
2320
include_directories(${COREPAL_SOURCE_DIR}/inc/rt)
@@ -49,7 +46,8 @@ add_custom_target(
4946
add_library_clr(usereventsprovider
5047
OBJECT
5148
${USEREVENTS_PROVIDER_SOURCES}
49+
${LinuxTracepoints_sources}
5250
)
5351

5452
set_target_properties(usereventsprovider PROPERTIES LINKER_LANGUAGE CXX)
55-
add_dependencies(usereventsprovider eventing_headers eventheader-tracepoint tracepoint)
53+
add_dependencies(usereventsprovider eventing_headers)

src/coreclr/vm/eventing/userevents/LinuxTracepoints/README

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/coreclr/vm/eventing/userevents/LinuxTracepoints/libeventheader-tracepoint/src/eventheader-tracepointConfig.cmake.in

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/coreclr/vm/eventing/userevents/LinuxTracepoints/libtracepoint/src/tracepointConfig.cmake.in

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
1.3.3
2+
https://github.com/microsoft/LinuxTracepoints/tree/a817b91dfb08b2929ec6d48a211644e3394bf1c7
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# IMPORTANT: do not use add_compile_options(), add_definitions() or similar functions here since it will leak to the including projects
2+
3+
include_directories(${CMAKE_CURRENT_LIST_DIR}/LinuxTracepoints/libtracepoint/include)
4+
include_directories(${CMAKE_CURRENT_LIST_DIR}/LinuxTracepoints/libeventheader-tracepoint/include)
5+
6+
set(LinuxTracepoints_sources_base
7+
libtracepoint/src/tracepoint.c
8+
libeventheader-tracepoint/src/eventheader-tracepoint.c)
9+
10+
11+
addprefix(LinuxTracepoints_sources "${CMAKE_CURRENT_LIST_DIR}/LinuxTracepoints" "${LinuxTracepoints_sources_base}")
File renamed without changes.
File renamed without changes.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# LinuxTracepoints Change Log
2+
3+
## v1.3.4 (TBD)
4+
5+
- libtracepoint-control: New `tracepoint-collect` tool that records tracepoint
6+
events into a perf.data file.
7+
- libtracepoint-control: TracepointSession SavePerfDataFile adds a
8+
`PERF_RECORD_FINISHED_INIT` record to the generated perf.data file.
9+
- libeventheader: tool `eventheader-register` deleted. Instead, use
10+
`tracepoint-register` from libtracepoint.
11+
12+
## v1.3.3 (2024-04-15)
13+
14+
- BUG FIX: EADDRINUSE returned during TraceLoggingRegister on newer kernels.
15+
The "name already in use" detection splits on whitespace, while all other
16+
processing splits on semicolon. Fix by adding space after each semicolon
17+
in `EVENTHEADER_COMMAND_TYPES`.
18+
- libtracepoint-decode: In pipe mode, load event names at FinishedInit instead
19+
of HeaderLastFeature since not all traces emit HeaderLastFeature.
20+
- libtracepoint-decode: Recognize files from LP32 systems as 32-bit.
21+
- libtracepoint: new tool `tracepoint-register` for pre-registering
22+
tracepoints.
23+
- libeventheader: existing tool `eventheader-register` is deprecated in
24+
favor of `tracepoint-register`.
25+
- libeventheader-decode-dotnet: Moved to separate repository
26+
[LinuxTracepoints-Net](https://github.com/microsoft/LinuxTracepoints-Net).
27+
28+
## v1.3.2 (2024-02-27)
29+
30+
- Bug fix: Open `user_events_data` for `O_WRONLY` instead of `O_RDWR`.
31+
32+
## v1.3.1 (2024-01-11)
33+
34+
- `TracepointSession` supports per-CPU buffer sizes (including 0) to allow
35+
memory usage optimization when trace producers are known to be bound to
36+
specific CPUs.
37+
- `TracepointSession` uses `PERF_ATTR_SIZE_VER3` for the size of
38+
`perf_event_attr` to minimize the chance of incompatibilities.
39+
40+
## v1.3.0 (2023-11-27)
41+
42+
- **Breaking changes** to `PerfDataFile`:
43+
- `dataFile.AttrCount()` method replaced by `EventDescCount()` method.
44+
- `dataFile.Attr(index)` method replaced by `EventDesc(index)` method.
45+
The returned `PerfEventDesc` object contains an `attr` pointer.
46+
- `dataFile.EventDescById(id)` method replaced by `FindEventDescById(id)`.
47+
- **Breaking changes** to `PerfSampleEventInfo`:
48+
- `eventInfo.session` field renamed to `session_info`.
49+
- `eventInfo.attr` field replaced by `Attr()` method.
50+
- `eventInfo.name` field replaced by `Name()` method.
51+
- `eventInfo.sample_type` field replaced by `SampleType()` method.
52+
- `eventInfo.raw_meta` field replaced by `Metadata()` method.
53+
- **Breaking changes** to `TracepointSession`:
54+
- `session.EnableTracePoint(...)` method renamed to `EnableTracepoint(...)`.
55+
- `session.DisableTracePoint(...)` method renamed to `DisableTracepoint(...)`.
56+
- `EventFormatter` formats timestamps as date-time if clock information is
57+
available in the event metadata. If clock information is not present, it
58+
continues to format timestamps as seconds.
59+
- `TracepointSession` provides `SavePerfDataFile(filename)` method to save
60+
the current contents of the session buffers into a `perf.data` file.
61+
- `TracepointSession` now includes ID in default sample type.
62+
- `TracepointSession` records clock information from the session.
63+
- `TracepointSession` provides access to information about the tracepoints
64+
that have been added to the session (metadata, status, statistics).
65+
- `PerfDataFile` decodes clock information from perf.data files if present.
66+
- `PerfDataFile` provides access to more metadata via `PerfEventDesc` struct.
67+
- `PerfDataFile` provides `EventDataSize` for determining the size of an event.
68+
- New `PerfDataFileWriter` class for generating `perf.data` files.
69+
- Changed procedure for locating the `user_events_data` file.
70+
- Old: parse `/proc/mounts` to determine the `tracefs` or `debugfs` mount
71+
point, then use that as the root for the `user_events_data` path.
72+
- New: try `/sys/kernel/tracing/user_events_data`; if that doesn't exist,
73+
parse `/proc/mounts` to find the `tracefs` or `debugfs` mount point.
74+
- Rationale: Probe an absolute path so that containers don't have to
75+
create a fake `/proc/mounts` and for efficiency in the common case.
76+
77+
## v1.2.1 (2023-07-24)
78+
79+
- Prefer `user_events_data` from `tracefs` over `user_events_data` from
80+
`debugfs`.
81+
82+
## v1.2 (2023-06-27)
83+
84+
- Added "Preregister" methods to the `TracepointCache` class so that a
85+
controller can pre-register events that it wants to collect.
86+
- If no consumers have enabled a tracepoint, the kernel now returns `EBADF`.
87+
The provider APIs have been updated to be consistent with the new behavior.
88+
89+
## v1.1 (2023-06-20)
90+
91+
- Add namespaces to the C++ APIs.
92+
- Move non-eventheader logic from eventheader-decode to new tracepoint-decode
93+
library.
94+
- Add new libtracepoint-control library.

0 commit comments

Comments
 (0)