Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete dump Cpu profiling #5171

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ scripts/docker/output/

# UAPI header generated for libbpf package-based builds
src/cc/compat/linux/bpf.h
# output
bccprofile
output_svg
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "${default}"
}
],
"version": 4
}
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/test",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/usr/bin/gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "makebuild"
}
]
}
97 changes: 97 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"files.associations": {
"iostream": "cpp",
"ostream": "cpp",
"unordered_set": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"random": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"limits": "cpp",
"new": "cpp",
"numbers": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"typeinfo": "cpp",
"list": "cpp",
"climits": "cpp",
"bitset": "cpp",
"any": "cpp",
"barrier": "cpp",
"cfenv": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"coroutine": "cpp",
"csetjmp": "cpp",
"csignal": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cuchar": "cpp",
"forward_list": "cpp",
"optional": "cpp",
"ratio": "cpp",
"regex": "cpp",
"source_location": "cpp",
"fstream": "cpp",
"future": "cpp",
"iomanip": "cpp",
"latch": "cpp",
"mutex": "cpp",
"ranges": "cpp",
"scoped_allocator": "cpp",
"semaphore": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"sstream": "cpp",
"stop_token": "cpp",
"syncstream": "cpp",
"thread": "cpp",
"typeindex": "cpp",
"valarray": "cpp",
"variant": "cpp",
"queue": "cpp",
"filesystem": "cpp",
"stack": "cpp",
"profile_v1.skel.h": "c",
"profile.h": "c",
"maps.bpf.h": "c"
}
}
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "makebuild",
"type": "shell",
"command": "source compiler.bash"
}
]
}
114 changes: 57 additions & 57 deletions libbpf-tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,62 +39,62 @@ BZ_APPS = \
opensnoop \
#

APPS = \
bashreadline \
bindsnoop \
biolatency \
biopattern \
biosnoop \
biostacks \
biotop \
bitesize \
cachestat \
capable \
cpudist \
cpufreq \
drsnoop \
execsnoop \
exitsnoop \
filelife \
filetop \
fsdist \
fsslower \
funclatency \
gethostlatency \
hardirqs \
javagc \
klockstat \
ksnoop \
llcstat \
mdflush \
mountsnoop \
numamove \
offcputime \
oomkill \
profile \
readahead \
runqlat \
runqlen \
runqslower \
sigsnoop \
slabratetop \
softirqs \
solisten \
statsnoop \
syncsnoop \
syscount \
tcptracer \
tcpconnect \
tcpconnlat \
tcplife \
tcppktlat \
tcprtt \
tcpstates \
tcpsynbl \
tcptop \
vfsstat \
wakeuptime \
$(BZ_APPS) \
APPS = fsdist fsslower profile profile_v1 sigsnoop \
# bashreadline \
# bindsnoop \
# biolatency \
# biopattern \
# biosnoop \
# biostacks \
# biotop \
# bitesize \
# cachestat \
# capable \
# cpudist \
# cpufreq \
# drsnoop \
# execsnoop \
# exitsnoop \
# filelife \
# filetop \
# fsdist \
# fsslower \
# funclatency \
# gethostlatency \
# hardirqs \
# javagc \
# klockstat \
# ksnoop \
# llcstat \
# mdflush \
# mountsnoop \
# numamove \
# offcputime \
# oomkill \
# profile \
# readahead \
# runqlat \
# runqlen \
# runqslower \
# sigsnoop \
# slabratetop \
# softirqs \
# solisten \
# statsnoop \
# syncsnoop \
# syscount \
# tcptracer \
# tcpconnect \
# tcpconnlat \
# tcplife \
# tcppktlat \
# tcprtt \
# tcpstates \
# tcpsynbl \
# tcptop \
# vfsstat \
# wakeuptime \
# $(BZ_APPS) \
#

# export variables that are used in Makefile.btfgen as well.
Expand Down Expand Up @@ -184,7 +184,7 @@ $(BPFTOOL): | $(BPFTOOL_OUTPUT)

$(APPS): %: $(OUTPUT)/%.o $(COMMON_OBJ) $(LIBBPF_OBJ) | $(OUTPUT)
$(call msg,BINARY,$@)
$(Q)$(CC) $(CFLAGS) $^ $(LDFLAGS) -lelf -lz -o $@
$(Q)$(CC) $(CFLAGS) $^ $(LDFLAGS) -lelf -lz -lpthread -o $@

ifeq ($(USE_BLAZESYM),1)
$(patsubst %,$(OUTPUT)/%.o,$(BZ_APPS)): $(OUTPUT)/blazesym.h
Expand Down
Binary file added libbpf-tools/bccprofile.tar.gz
Binary file not shown.
Loading
Loading