From 8bd6c392179c4bd2aec3cfada42fee36a4c18dd6 Mon Sep 17 00:00:00 2001 From: Derek Bruening Date: Tue, 18 Jul 2017 17:52:48 -0400 Subject: [PATCH] i#2006 generalize drcachesim: declare drmemtrace_client_main (#2546) Adds drmemtrace_client_main() to the drmemtrace.h header for use by applications statically linking in the drmemtrace client. The existing burst_static test for this linking feature did not need a declaration as it tests a duplicate weak symbol, so there are no test changes here. --- clients/drcachesim/tracer/drmemtrace.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/clients/drcachesim/tracer/drmemtrace.h b/clients/drcachesim/tracer/drmemtrace.h index 05857f6503a..5a056c27988 100644 --- a/clients/drcachesim/tracer/drmemtrace.h +++ b/clients/drcachesim/tracer/drmemtrace.h @@ -54,6 +54,16 @@ typedef enum { DRMEMTRACE_ERROR_INVALID_PARAMETER, /**< Operation failed: invalid parameter */ } drmemtrace_status_t; +DR_EXPORT +/** + * To support statically linking multiple clients on UNIX, dr_client_main() inside + * drmemtrace is a weak symbol which just calls the real initializer + * drmemtrace_client_main(). An enclosing application can override dr_client_main() + * and invoke drmemtrace_client_main() explicitly at a time of its choosing. + */ +void +drmemtrace_client_main(client_id_t id, int argc, const char *argv[]); + /** * Function for file open. * The file access mode is set by the \p mode_flags argument which is drawn from