This is my example code.
#include <stdio.h>
#include <osv/trace.hh>
TRACEPOINT(trace_hello, "i=%d", int);
int main(){
printf("Hello from C code\n");
printf("enabled: %lx\n", trace_hello.enabled());
for(int i =0; i<128;++i){
trace_hello(i);
}
return 0;
}
It seems that TRACEPOINT use tracepoint_patch_sites sections which are
linked to loader. (arch/x64/arch-trace.hh)
However, application or modules are dynamically linked, so their tracepoint
are not visible to GDB.
loader.ld's tracepoint_patch_sites:
.tracepoint_patch_sites ALIGN(8) : AT(ADDR(.tracepoint_patch_sites) -
OSV_KERNEL_VM_SHIFT) {
__tracepoint_patch_sites_start = .;
*(.tracepoint_patch_sites)
__tracepoint_patch_sites_end = .;
} : text
2020년 9월 8일 화요일 오후 1시 49분 35초 UTC+9에 [email protected]님이 작성:
> I think it should be possible given this file which is part of java app
> has tracepoints -
>
> modules/java-base/balloon/jvm_balloon.cc.
>
> But I have not tested it myself.
>
>
> Can you give us your example?
>
>
> Waldek
>
> On Monday, August 31, 2020 at 10:33:27 AM UTC-4 Wonsup Yoon wrote:
>
>> Hi,
>>
>> Is it possible to use TRACEPOINTs for modules or apps?
>> I've tested, but it does not working for me.
>>
>> Best regards,
>> Wonsup Yoon
>>
>
--
You received this message because you are subscribed to the Google Groups "OSv
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/osv-dev/a47cec6e-55d1-42ed-952e-dcc60b1575ffn%40googlegroups.com.