search for: __builtin_return_address

Displaying 20 results from an estimated 49 matches for "__builtin_return_address".

2015 Dec 01
2
Expected behavior of __builtin_return_address() with inlining?
Hi, I am trying to understand what should be the expected behavior of __builtin_return_address(0) when inlining has happened. So, the GCC doc from https://gcc.gnu.org/onlinedocs/gcc/Return-Address.html says: (I used GCC doc because I could not find equivalent Clang/LLVM builtin doc) When inlining the expected behavior is that the function returns the address of the function that is retu...
2011 Dec 27
4
[LLVMdev] -f[no-]omit-frame-pointer
On Tue, Dec 27, 2011 at 12:22 PM, Joerg Sonnenberger < joerg at britannica.bec.de> wrote: > On Tue, Dec 27, 2011 at 12:10:54PM -0800, Kostya Serebryany wrote: > > What would be the best fix for asan? > > Can you be explicit what you need to asan? Just the equivalent of > __builtin_return_address(0) or do you really need a full stack trace? > asan-rt uses __builtin_return_address(0) to get the full stack trace. See compiler-rt/lib/asan/asan_stack.cc (AsanStackTrace::FastUnwindStack) It checks the current thread's stack bounds to avoid a wild dereference. Asan does not use unsafe __...
2011 Dec 28
0
[LLVMdev] -f[no-]omit-frame-pointer
..., Joerg Sonnenberger < > joerg at britannica.bec.de> wrote: > > > On Tue, Dec 27, 2011 at 12:10:54PM -0800, Kostya Serebryany wrote: > > > What would be the best fix for asan? > > > > Can you be explicit what you need to asan? Just the equivalent of > > __builtin_return_address(0) or do you really need a full stack trace? > > > > asan-rt uses __builtin_return_address(0) to get the full stack trace. > See compiler-rt/lib/asan/asan_stack.cc (AsanStackTrace::FastUnwindStack) > It checks the current thread's stack bounds to avoid a wild dereference. &gt...
2011 Dec 27
0
[LLVMdev] -f[no-]omit-frame-pointer
On Tue, Dec 27, 2011 at 12:10:54PM -0800, Kostya Serebryany wrote: > What would be the best fix for asan? Can you be explicit what you need to asan? Just the equivalent of __builtin_return_address(0) or do you really need a full stack trace? Joerg
2011 Dec 27
4
[LLVMdev] -f[no-]omit-frame-pointer
On Tue, Dec 27, 2011 at 12:06 PM, Eli Friedman <eli.friedman at gmail.com>wrote: > On Tue, Dec 27, 2011 at 11:48 AM, Kostya Serebryany <kcc at google.com> > wrote: > > Hi, > > > > It looks like the default for -fomit-frame-pointer has recently changed > from > > "no" to "yes at O1 and higher", but I did not see the commit. > >
2011 Dec 28
0
[LLVMdev] -f[no-]omit-frame-pointer
...PM, Joerg Sonnenberger > <joerg at britannica.bec.de> wrote: >> >> On Tue, Dec 27, 2011 at 12:10:54PM -0800, Kostya Serebryany wrote: >> > What would be the best fix for asan? >> >> Can you be explicit what you need to asan? Just the equivalent of >> __builtin_return_address(0) or do you really need a full stack trace? > > > asan-rt uses __builtin_return_address(0) to get the full stack trace. > See compiler-rt/lib/asan/asan_stack.cc (AsanStackTrace::FastUnwindStack) > It checks the current thread's stack bounds to avoid a wild dereference. > I th...
2009 Sep 16
3
[LLVMdev] llc and debug information
Hi all, I'm having an issue with debug information and llc. A test program: #include <iostream> using namespace std; void foo() { cout << "My return address is " << __builtin_return_address(0) << endl << flush; } int main(int argc, char *argv[]) { foo(); return 0; } When I compile my test program to LLVM bytecode, and then use llc to take the bytecode to assembly, llc appears to strip the debugging information along the way: > llvm-g++ -g -c -emit-ll...
2018 Apr 18
7
[PATCH] net: don't use kvzalloc for DMA memory
On Wed, 18 Apr 2018, David Miller wrote: > From: Mikulas Patocka <mpatocka at redhat.com> > Date: Wed, 18 Apr 2018 12:44:25 -0400 (EDT) > > > The structure net_device is followed by arbitrary driver-specific data > > (accessible with the function netdev_priv). And for virtio-net, these > > driver-specific data must be in DMA memory. > > And we are saying
2018 Apr 19
2
[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM
...IG_DEBUG_VM > gfp_t kmalloc_flags = flags; > void *ret; > > @@ -426,6 +427,7 @@ void *kvmalloc_node(size_t size, gfp_t f > */ > if (ret || size <= PAGE_SIZE) > return ret; > +#endif > > return __vmalloc_node_flags_caller(size, node, flags, > __builtin_return_address(0)); Well, it doesn't have to be done at compile-time, does it? We could add a knob (in debugfs, presumably) which enables this at runtime. That's far more user-friendly.
2018 Apr 19
2
[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM
...IG_DEBUG_VM > gfp_t kmalloc_flags = flags; > void *ret; > > @@ -426,6 +427,7 @@ void *kvmalloc_node(size_t size, gfp_t f > */ > if (ret || size <= PAGE_SIZE) > return ret; > +#endif > > return __vmalloc_node_flags_caller(size, node, flags, > __builtin_return_address(0)); Well, it doesn't have to be done at compile-time, does it? We could add a knob (in debugfs, presumably) which enables this at runtime. That's far more user-friendly.
2009 Sep 16
0
[LLVMdev] llc and debug information
...t 1:34 PM, Nick Jalbert <jalbert at eecs.berkeley.edu> wrote: > Hi all, > I'm having an issue with debug information and llc.  A test program: > #include <iostream> > using namespace std; > void foo() { >     cout << "My return address is " << __builtin_return_address(0) << >         endl << flush; > } > int main(int argc, char *argv[]) { >     foo(); >     return 0; > } > > When I compile my test program to LLVM bytecode, and then use llc to take > the bytecode to assembly, llc appears to strip the debugging information &g...
2018 Apr 24
2
[PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG
...multiple larger blocks and therefore > @@ -427,6 +434,9 @@ void *kvmalloc_node(size_t size, gfp_t f > if (ret || size <= PAGE_SIZE) > return ret; > > +#ifdef CONFIG_DEBUG_SG > +do_vmalloc: > +#endif > return __vmalloc_node_flags_caller(size, node, flags, > __builtin_return_address(0)); > } -- Michal Hocko SUSE Labs
2018 Apr 24
2
[PATCH v3] kvmalloc: always use vmalloc if CONFIG_DEBUG_SG
...multiple larger blocks and therefore > @@ -427,6 +434,9 @@ void *kvmalloc_node(size_t size, gfp_t f > if (ret || size <= PAGE_SIZE) > return ret; > > +#ifdef CONFIG_DEBUG_SG > +do_vmalloc: > +#endif > return __vmalloc_node_flags_caller(size, node, flags, > __builtin_return_address(0)); > } -- Michal Hocko SUSE Labs
2016 Oct 28
2
Basic block execution over time
Hello All, How can I keep track of the different basic blocks of a program executed over time? Or in other words, how can I annotate the block name (block_a) and the time/cycle at which that blocs (block_a) was executed, and do this for all the blocks on a reasonable simple program? Regards, Raul. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2018 Apr 19
1
[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM
...IG_DEBUG_VM > gfp_t kmalloc_flags = flags; > void *ret; > > @@ -426,6 +427,7 @@ void *kvmalloc_node(size_t size, gfp_t f > */ > if (ret || size <= PAGE_SIZE) > return ret; > +#endif > > return __vmalloc_node_flags_caller(size, node, flags, > __builtin_return_address(0));
2018 Apr 19
1
[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM
...t; > @@ -426,6 +427,7 @@ void *kvmalloc_node(size_t size, gfp_t f > > > */ > > > if (ret || size <= PAGE_SIZE) > > > return ret; > > > +#endif > > > > > > return __vmalloc_node_flags_caller(size, node, flags, > > > __builtin_return_address(0)); > > > > Well, it doesn't have to be done at compile-time, does it? We could > > add a knob (in debugfs, presumably) which enables this at runtime. > > That's far more user-friendly. > > But who will turn it on in debugfs? But who will turn it on in Kc...
2013 Oct 10
3
[LLVMdev] A new builtin: __builtin_stack_pointer()
...ut often adds in 3 extra instructions since you need to copy the stack pointer to another register, but first that register needs to be saved to the stack and then restored after the stackpointer has been used; inefficient. Another way would be to introduce a new builtin in parallel to others like __builtin_return_address(). Essentially adding a __builtin_stack_pointer() which does what the above code does. The idea would be to get something like this added to both clang and gcc in order to make this work across compilers, and across arches. It ends up being a trivial patch for clang (see below). We're still lo...
2007 Nov 28
1
Cross-compiling asterisk-1.4 for Debian on a slug
...fcn.c:1266: error: dereferencing pointer to incomplete type dlfcn.c:1267: error: dereferencing pointer to incomplete type dlfcn.c: In function `search_linked_libs': dlfcn.c:515: warning: value computed is not used dlfcn.c: In function `dlsymIntern': dlfcn.c:563: warning: unsupported arg to `__builtin_return_address' dlfcn.c: In function `dladdr': dlfcn.c:1198: warning: value computed is not used dlfcn.c:1221: warning: value computed is not used dlfcn.c:1235: warning: value computed is not used dlfcn.c: At top level: dlfcn.c:133: error: storage size of `mainStatus' isn't known dlfcn.c:83: warni...
2018 Apr 19
0
[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM
...de(size_t size, gfp_t flags, int node) { +#ifndef CONFIG_DEBUG_VM gfp_t kmalloc_flags = flags; void *ret; @@ -426,6 +427,7 @@ void *kvmalloc_node(size_t size, gfp_t f */ if (ret || size <= PAGE_SIZE) return ret; +#endif return __vmalloc_node_flags_caller(size, node, flags, __builtin_return_address(0));
2018 Apr 19
0
[PATCH] kvmalloc: always use vmalloc if CONFIG_DEBUG_VM
...t; > void *ret; > > > > @@ -426,6 +427,7 @@ void *kvmalloc_node(size_t size, gfp_t f > > */ > > if (ret || size <= PAGE_SIZE) > > return ret; > > +#endif > > > > return __vmalloc_node_flags_caller(size, node, flags, > > __builtin_return_address(0)); > > Well, it doesn't have to be done at compile-time, does it? We could > add a knob (in debugfs, presumably) which enables this at runtime. > That's far more user-friendly. But who will turn it on in debugfs? It should be default for debugging kernels, so that users u...