[MDEV-14315] Reflect use of tcmalloc in a system variable and error log Created: 2017-11-07  Updated: 2017-12-19  Resolved: 2017-12-19

Status: Closed
Project: MariaDB Server
Component/s: Server
Fix Version/s: 10.3.3

Type: Task Priority: Major
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None


 Description   

As discussed, it would be useful to be able to detect usage of tcmalloc from a running server (via system variables) and after the fact, from the server error log.

The existing variable is called version_malloc_library.
wlad suggests the variable should be renamed.



 Comments   
Comment by Vesa Pentti (Inactive) [ 2017-11-21 ]

const char* tc_version(int* major, int* minor, const char** patch);

Comment by Vesa Pentti (Inactive) [ 2017-12-11 ]

The variable is the same: 'version_malloc_library'
The output for tcmalloc currently looks like: tcmalloc gperftools 2.4

Comment by Sergei Golubchik [ 2017-12-12 ]

1. guess_malloc_library.cc looks like pure C and a generally useful helper, so it'd make sense to move it to mysys/guess_malloc_library.c (and in this case guess_malloc_library.h is not needed, the prototype can be in my_sys.h.
2. declare only one static char [128] buffer, not two.
3. #ifndef HAVE_DLOPEN is good, but put the rest of the function in the #else branch (so that compiler wouldn't see dlsym()).

otherwise looks good, thanks!

Comment by Sergei Golubchik [ 2017-12-16 ]

Just one more change and ok to push into bb-10.2-ext:

  • move static char buf[128]; declaration to be before the very first statement, as C90 requires. We still get compiled with old compilers from time to time.
Comment by Vesa Pentti (Inactive) [ 2017-12-16 ]

Roger that

Generated at Thu Feb 08 08:12:35 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.