mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-10 13:45:07 +08:00
Deploying to gh-pages from @ eunomia-bpf/bpf-developer-tutorial@ab0d1eef08 🚀
This commit is contained in:
BIN
third_party/blazesym/data/dwarf-example
vendored
Executable file
BIN
third_party/blazesym/data/dwarf-example
vendored
Executable file
Binary file not shown.
22
third_party/blazesym/data/test-gsym.c
vendored
Normal file
22
third_party/blazesym/data/test-gsym.c
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/* The sample program is used to generate test.gsym.
|
||||
*
|
||||
* Chosen functions are placed in dedicated sections to allow for control placement.
|
||||
*/
|
||||
|
||||
__attribute__((section(".text.factorial"))) unsigned int
|
||||
factorial(unsigned int n) {
|
||||
if (n == 0)
|
||||
return 1;
|
||||
return factorial(n - 1) * n;
|
||||
}
|
||||
|
||||
static inline void
|
||||
factorial_inline_wrapper() {
|
||||
factorial(5);
|
||||
}
|
||||
|
||||
__attribute__((section(".text.main"))) int
|
||||
main(int argc, const char *argv[]) {
|
||||
factorial_inline_wrapper();
|
||||
return 0;
|
||||
}
|
||||
40
third_party/blazesym/data/test-gsym.ld
vendored
Normal file
40
third_party/blazesym/data/test-gsym.ld
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
SECTIONS {
|
||||
.text (0x2000000) : {
|
||||
*(.text.main)
|
||||
*(.text)
|
||||
. = ABSOLUTE(0x2000100);
|
||||
*(.text.factorial)
|
||||
}
|
||||
.data : {
|
||||
*(.data)
|
||||
}
|
||||
.bss : {
|
||||
*(.bss)
|
||||
}
|
||||
|
||||
/* DWARF debug sections.
|
||||
Symbols in the DWARF debugging sections are relative to the beginning
|
||||
of the section so we begin them at 0.
|
||||
*/
|
||||
/* DWARF 1. */
|
||||
.debug 0 : { *(.debug) }
|
||||
.line 0 : { *(.line) }
|
||||
/* GNU DWARF 1 extensions. */
|
||||
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
||||
.debug_sfnames 0 : { *(.debug_sfnames) }
|
||||
/* DWARF 1.1 and DWARF 2. */
|
||||
.debug_aranges 0 : { *(.debug_aranges) }
|
||||
.debug_pubnames 0 : { *(.debug_pubnames) }
|
||||
/* DWARF 2. */
|
||||
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
||||
.debug_abbrev 0 : { *(.debug_abbrev) }
|
||||
.debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
|
||||
.debug_frame 0 : { *(.debug_frame) }
|
||||
.debug_str 0 : { *(.debug_str) }
|
||||
.debug_loc 0 : { *(.debug_loc) }
|
||||
.debug_macinfo 0 : { *(.debug_macinfo) }
|
||||
|
||||
/DISCARD/ : {
|
||||
*(.*)
|
||||
}
|
||||
}
|
||||
22
third_party/blazesym/data/test.c
vendored
Normal file
22
third_party/blazesym/data/test.c
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* The sample program is used to generate test.bin.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
static
|
||||
unsigned int fibonacci(unsigned int n) {
|
||||
if (n <= 1)
|
||||
return n;
|
||||
return fibonacci(n - 1) + fibonacci(n - 2);
|
||||
}
|
||||
|
||||
int
|
||||
main() {
|
||||
int i;
|
||||
printf("calculate fibonacci(n); n = ");
|
||||
scanf("%d", &i);
|
||||
|
||||
printf("fibonacci(%d) = %d\n", i, fibonacci(i));
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user