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

add options for other valgrind tools in MTR

Details

    Description

      Using other valgrind tools in MTR is a little difficult as the MTR ties the tool to memcheck or calllgrind.

      https://github.com/MariaDB/server/pull/194 provides a valgrind-tool option for easy selection.

      MTR_TEST_NAME is also exported for recording results per test run (using a custom --valgrind-path= wrapper script).

      Attachments

        Activity

          danblack Daniel Black created issue -
          danblack Daniel Black made changes -
          Field Original Value New Value
          Labels tests contribution foundation patch tests
          svoj Sergey Vojtovich made changes -
          danblack Daniel Black made changes -
          svoj Sergey Vojtovich made changes -
          Assignee Elena Stepanova [ elenst ]

          Hi Daniel,

          I see a few problems here.

          First of all, MTR already has "--valgrind-option" to pass parameters to valgrind, and "--tool" can be one of them. Wouldn't it be better to parse the array properly to check whether the tool was set? The new option introduces an alternative way to do the same thing, which means they can set different tools at the same time, which is just confusing.

          Further, the new option cannot be used by itself now, it still requires something in "--valgrind-option", because otherwise MTR adds "--show-reachable", which does not work with anything but memcheck. At the very least show-reachable should be moved from default_valgrind_args to the block where other options for memcheck are set.

          Finally, if we decide to do this, the callgrind logic needs to be cleaned up. It does not work anyway, as it sets the option --base=xxx which was apparently removed from valgrind years ago; and in a different place of the script it also sets trace-children, only for callgrind. Why is it so, probably nobody remembers.

          My suggestion is instead
          1) to use --valgrind-option for setting the tool (and other things if necessary);
          2) if --tool is present among provided valgrind options, skip the logic which sets memcheck-specific options, otherwise preserve it;
          3) keep --callgrind option for compatibility, but convert it into "--tool=callgrind" at the very beginning, and get rid of the rest of the special logic related to it.

          I have no objections against exporting MTR_TEST_NAME if it's anyhow useful. I expect the use will be limited, since in a general case the server is not restarted between separate test runs, so updated values can only be picked up by the wrapper if mysqltest itself is run under valgrind. But maybe it will become handy for some other purposes.

          elenst Elena Stepanova added a comment - Hi Daniel, I see a few problems here. First of all, MTR already has "--valgrind-option" to pass parameters to valgrind, and "--tool" can be one of them. Wouldn't it be better to parse the array properly to check whether the tool was set? The new option introduces an alternative way to do the same thing, which means they can set different tools at the same time, which is just confusing. Further, the new option cannot be used by itself now, it still requires something in "--valgrind-option", because otherwise MTR adds "--show-reachable", which does not work with anything but memcheck. At the very least show-reachable should be moved from default_valgrind_args to the block where other options for memcheck are set. Finally, if we decide to do this, the callgrind logic needs to be cleaned up. It does not work anyway, as it sets the option --base=xxx which was apparently removed from valgrind years ago; and in a different place of the script it also sets trace-children, only for callgrind. Why is it so, probably nobody remembers. My suggestion is instead 1) to use --valgrind-option for setting the tool (and other things if necessary); 2) if --tool is present among provided valgrind options, skip the logic which sets memcheck-specific options, otherwise preserve it; 3) keep --callgrind option for compatibility, but convert it into "--tool=callgrind" at the very beginning, and get rid of the rest of the special logic related to it. I have no objections against exporting MTR_TEST_NAME if it's anyhow useful. I expect the use will be limited, since in a general case the server is not restarted between separate test runs, so updated values can only be picked up by the wrapper if mysqltest itself is run under valgrind. But maybe it will become handy for some other purposes.
          elenst Elena Stepanova made changes -
          Labels contribution foundation patch tests contribution foundation need_feedback patch tests
          elenst Elena Stepanova added a comment - Merged into 10.1 tree as https://github.com/MariaDB/server/commit/e6a64e8f0ea36f12bd24ba906aa1f4e2e367a8e0
          elenst Elena Stepanova made changes -
          Fix Version/s 10.1.17 [ 22102 ]
          Fix Version/s 10.1 [ 16100 ]
          Assignee Elena Stepanova [ elenst ] Daniel Black [ danblack ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          julien.fritsch Julien Fritsch made changes -
          Labels contribution foundation need_feedback patch tests contribution foundation patch tests
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 76244 ] MariaDB v4 [ 132906 ]

          People

            danblack Daniel Black
            danblack Daniel Black
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.