Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install uftrace
- uses: taiki-e/install-action@v2
with:
tool: cargo-binutils
- uses: mkroening/rust-toolchain-toml@main
with:
toolchain: nightly
Expand All @@ -75,6 +78,7 @@ jobs:
run: |
mkdir tracedir
../../target/debug/rftrace-rs-test
- run: rust-nm --demangle --numeric-sort ../../target/debug/rftrace-rs-test | tee tracedir/rftrace-rs-test.sym
- name: Replay
run: uftrace replay --data=tracedir --output-fields=tid | tee ci.snap
- name: Compare to snapshot
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The full trace consists of 5+ files, 4 for metadata plus 1 per TID which contain
- `/info`: general info about cpu, mem, cmdline, version
- `/task.txt`: contains PID, TID, SID<->exename mapping
- `/sid-<SID>.map`: contains mapping of addr to exename. By default, the memory map is faked. You can enable linux-mode, in which case `/proc/self/maps` is copied.
- `/<exename>.sym`: contains symbols of exe, like output of `nm -n` (has to be sorted!). Symbols are never generated and always have to be done by hand.
- `/<exename>.sym`: contains symbols of exe, like output of `nm --demangle -n` (has to be sorted!). Symbols are never generated and always have to be done by hand.


### Chrome trace viewer
Expand Down
2 changes: 1 addition & 1 deletion examples/hermitc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ run: example
sleep 1
sudo chmod 777 /tmp/vhostqemu
qemu-system-x86_64 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr -enable-kvm -display none -smp 1 -m 1G -serial stdio -kernel $(RUSTY_LOADER) -initrd $(ROOT_DIR)/example -chardev socket,id=char0,path=/tmp/vhostqemu -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=tracedir -object memory-backend-file,id=mem,size=1G,mem-path=/dev/shm,share=on -numa node,memdev=mem
nm -n $(ROOT_DIR)/example > tracedir/example.sym
nm --demangle -n $(ROOT_DIR)/example > tracedir/example.sym
uftrace dump -d tracedir --chrome > tracedir/trace.json

.PHONY: default hermit clean run
2 changes: 1 addition & 1 deletion examples/hermitrust/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ run: default
sleep 1
sudo chmod 777 /tmp/vhostqemu
qemu-system-x86_64 -cpu qemu64,apic,fsgsbase,rdtscp,xsave,fxsr -enable-kvm -display none -smp 1 -m 1G -serial stdio -kernel $(RUSTY_LOADER) -initrd $(BINARY) -chardev socket,id=char0,path=/tmp/vhostqemu -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=tracedir -object memory-backend-file,id=mem,size=1G,mem-path=/dev/shm,share=on -numa node,memdev=mem
nm -n $(BINARY) > tracedir/test.sym
nm --demangle -n $(BINARY) > tracedir/test.sym
uftrace dump -d tracedir --chrome > tracedir/trace.json


Expand Down
6 changes: 3 additions & 3 deletions rftrace-frontend/src/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub fn init(max_event_count: usize, overwriting: bool) -> &'static mut Events {

/// Dumps the traces with some faked metadata into the given folder. Uses the same format as uftrace, which should be used to parse them.
///
/// Will NOT generate symbols! You can generate them with `nm -n $BINARY > binary_name.sym`
/// Will NOT generate symbols! You can generate them with `nm --demangle -n $BINARY > binary_name.sym`
///
/// # Arguments
///
Expand Down Expand Up @@ -198,7 +198,7 @@ pub fn dump_full_uftrace(events: &mut Events, out_dir: &str, binary_name: &str)

if cfg!(target_os = "linux") {
println!(
"\nYou should generate symbols with `nm -n $BINARY > {}/$BINARY.sym`",
"\nYou should generate symbols with `nm --demangle -n $BINARY > {}/$BINARY.sym`",
out_dir
);
println!(
Expand All @@ -208,7 +208,7 @@ pub fn dump_full_uftrace(events: &mut Events, out_dir: &str, binary_name: &str)
println!(" Needs to contain at least [stack] and the binaries you want symbols of.");
} else {
println!(
"\nYou should generate symbols with `nm -n $BINARY > {}/{}.sym`",
"\nYou should generate symbols with `nm --demangle -n $BINARY > {}/{}.sym`",
out_dir, binary_name
);
}
Expand Down
2 changes: 1 addition & 1 deletion tools/create_fake_uftrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def create_fake_uftrace(dirname, tracefile, binary=None, PID=123, TID=42, SID=b"
# generate symbols
if binary:
print(" Generating symbols with nm")
nm_cmd = ['nm', '-n', binary]
nm_cmd = ['nm', '--demangle', '-n', binary]
with open(f"{dirname}/{EXENAME}.sym", "w") as symbolfile:
subprocess.run(nm_cmd, stdout=symbolfile)
else:
Expand Down
2 changes: 1 addition & 1 deletion tools/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def merge():
# if binary is specified, generate symbols for trace
if args.binary:
print("Generating symbols with nm")
nm_cmd = ['nm', '-n', args.binary]
nm_cmd = ['nm', '--demangle', '-n', args.binary]
with open(f"{args.TRACE}/{args.binaryname}.sym", "w") as symbolfile:
subprocess.run(nm_cmd, stdout=symbolfile)
else:
Expand Down
Loading