Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14315

Reflect use of tcmalloc in a system variable and error log

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3.3
    • Server
    • 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.

      Attachments

        Activity

          pentve Vesa Pentti (Inactive) added a comment - - edited

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

          pentve Vesa Pentti (Inactive) added a comment - - edited const char* tc_version(int* major, int* minor, const char** patch);

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

          pentve Vesa Pentti (Inactive) added a comment - The variable is the same: 'version_malloc_library' The output for tcmalloc currently looks like: tcmalloc gperftools 2.4

          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!

          serg Sergei Golubchik added a comment - 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!

          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.
          serg Sergei Golubchik added a comment - 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.

          Roger that

          pentve Vesa Pentti (Inactive) added a comment - Roger that

          People

            Unassigned Unassigned
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.