Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bpftrace
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bpftrace
Commits
24c5248d
Commit
24c5248d
authored
Sep 30, 2018
by
Alastair Robertson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tracepoint_variable_sized_types.py
parent
42ce08fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
scripts/tracepoint_variable_sized_types.py
scripts/tracepoint_variable_sized_types.py
+36
-0
No files found.
scripts/tracepoint_variable_sized_types.py
0 → 100644
View file @
24c5248d
# This script lists all the types in the kernel's tracepoint format files
# which appear with more than one size. This script's output should be
# compared to the code in TracepointFormatParser::adjust_integer_types()
import
glob
field_types
=
{}
for
format_file
in
glob
.
iglob
(
"/sys/kernel/debug/tracing/events/*/*/format"
):
for
line
in
open
(
format_file
):
if
not
line
.
startswith
(
"
\
t
field:"
):
continue
size_section
=
line
.
split
(
";"
)[
2
].
split
(
":"
)
if
size_section
[
0
]
!=
"
\
t
size"
:
continue
size_val
=
size_section
[
1
]
field_section
=
line
.
split
(
";"
)[
0
].
split
(
":"
)
if
field_section
[
0
]
!=
"
\
t
field"
:
continue
field_val
=
field_section
[
1
]
if
"["
in
field_val
or
"*"
in
field_val
:
continue
field_type
=
" "
.
join
(
field_val
.
split
()[:
-
1
])
if
field_type
not
in
field_types
:
field_types
[
field_type
]
=
set
()
field_types
[
field_type
].
add
(
size_val
)
for
t
in
sorted
(
field_types
):
sizes
=
field_types
[
t
]
if
len
(
sizes
)
>
1
:
sizes_str
=
","
.
join
(
sorted
(
sizes
))
print
(
f"
{
t
}
:
{
sizes_str
}
"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment