michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: michael@0: A stub library to LD_PRELOAD against an image that's been compiled michael@0: with -finstrument-functions. It dumps the address of the function michael@0: that's being entered upon function entry, and the address that's michael@0: being returned to on function exit. Addresses are dumped as binary michael@0: data to stdout. michael@0: michael@0: */ michael@0: michael@0: #include michael@0: michael@0: void michael@0: __cyg_profile_func_enter(void *this_fn, void *call_site) michael@0: { michael@0: write(STDOUT_FILENO, &this_fn, sizeof this_fn); michael@0: } michael@0: michael@0: void michael@0: __cyg_profile_func_exit(void *this_fn, void *call_site) michael@0: { michael@0: write(STDOUT_FILENO, &call_site, sizeof call_site); michael@0: }