Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70297

Upgrade XHProf to latest version

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Install the tideways_xhprof PHP extension

      Install the tideways extension for PHP7, see https://github.com/tideways/php-profiler-extension for Installation instructions. Or if you're on Ubuntu/LinuxMint, follow the instructions below

      Ubuntu/LinuxMint install instructions
      1. Update your system

        sudo apt update && sudo apt upgrade -y

      2. Download the precompiled tideways_xhprof extension installer for Debian-based systems:

        wget https://github.com/tideways/php-xhprof-extension/releases/download/v5.0.4/tideways-xhprof_5.0.4_amd64.deb

      3. Install the package

        sudo dpkg -i tideways-xhprof_5.0.4_amd64.deb
        

      4. Check your PHP version

        php -v
        

      5. Check the contents of /usr/lib/tideways_xhprof

        ls /usr/lib/tideways_xhprof

      6. Make sure that there is a .so file that matches your current PHP version. For example, if you're on PHP 7.4, then confirm that tideways_xhprof-7.4.so is available in that folder.
      7. Using your favourite editor, create a "tideways_xhprof.ini" under /etc/php/[YOUR_PHPVERSION]/mods-available. e.g. if you're on PHP 7.4 on LinuxMint with xed as the editor:

        sudo xed /etc/php/7.4/mods-available/tideways_xhprof.ini
        

      8. Paste the following line in tideways_xhprof.ini pointing to the path of the tideways_xhprof extension file matching your PHP version.

        extension=/usr/lib/tideways_xhprof/tideways_xhprof-7.4.so
        

      9. Enable the tideways_xhprof extension

        sudo phpenmod tideways_xhprof
        

      10. Install Graphviz. (This is required for generating the callgraph of the profiling run)

        sudo apt install graphviz
        

      11. Restart your webserver

        sudo service apache2 restart
        

      12. Check your phpinfo() page. Search for tideways_xhprof and confirm that it is present.

      Test

      1. Make sure "Developer mode" is turned on.
      2. Go to "Site administration / Development / Profiling"
      3. Tick "Enable profiling".
      4. Under "Profile these", enter "/index.php"
      5. Go to the "Site home".
      6. Scroll down to the bottom of the page. Confirm that there is a link named "This script has been profiled"
      7. Click the "This script has been profiled" link.
      8. Confirm that it loads okay.
      9. Click "Export this profiling run"
      10. Confirm that a .mpr file archive containing XML files is generated.
      11. Click "View profiling details".
      12. Confirm that a table of function calls is displayed.
      13. Click on "View Full Callgraph"
      14. Confirm that the call graph is generated.
      Show
      Install the tideways_xhprof PHP extension Install the tideways extension for PHP7, see https://github.com/tideways/php-profiler-extension for Installation instructions. Or if you're on Ubuntu/LinuxMint, follow the instructions below Ubuntu/LinuxMint install instructions Update your system sudo apt update && sudo apt upgrade -y Download the precompiled tideways_xhprof extension installer for Debian-based systems: wget https://github.com/tideways/php-xhprof-extension/releases/download/v5.0.4/tideways-xhprof_5.0.4_amd64.deb Install the package sudo dpkg -i tideways-xhprof_5.0.4_amd64.deb Check your PHP version php -v Check the contents of /usr/lib/tideways_xhprof ls /usr/lib/tideways_xhprof Make sure that there is a .so file that matches your current PHP version. For example, if you're on PHP 7.4, then confirm that tideways_xhprof-7.4.so is available in that folder. Using your favourite editor, create a " tideways_xhprof.ini " under /etc/php/ [YOUR_PHPVERSION] /mods-available. e.g. if you're on PHP 7.4 on LinuxMint with xed as the editor: sudo xed /etc/php/7.4/mods-available/tideways_xhprof.ini Paste the following line in tideways_xhprof.ini pointing to the path of the tideways_xhprof extension file matching your PHP version. extension=/usr/lib/tideways_xhprof/tideways_xhprof-7.4.so Enable the tideways_xhprof extension sudo phpenmod tideways_xhprof Install Graphviz. (This is required for generating the callgraph of the profiling run) sudo apt install graphviz Restart your webserver sudo service apache2 restart Check your phpinfo() page. Search for tideways_xhprof and confirm that it is present. Test Make sure " Developer mode " is turned on. Go to " Site administration / Development / Profiling " Tick " Enable profiling ". Under " Profile these ", enter " /index.php " Go to the " Site home ". Scroll down to the bottom of the page. Confirm that there is a link named " This script has been profiled " Click the " This script has been profiled " link. Confirm that it loads okay. Click " Export this profiling run " Confirm that a .mpr file archive containing XML files is generated. Click " View profiling details ". Confirm that a table of function calls is displayed. Click on " View Full Callgraph " Confirm that the call graph is generated.
    • Affected Branches:
      MOODLE_311_STABLE
    • Fixed Branches:
      MOODLE_311_STABLE
    • Epic Link:
    • Pull 3.11 Branch:
      MDL-70297-311
    • Pull Master Branch:
      MDL-70297-master
    • Story Points:
      5
    • Sprint:
      Moppies Kanban

      Description

      XHProf (/lib/xhprof/) 0.9.4 --> 2.2.3 : http://pecl.php.net/package/xhprof 

      See also:
      https://tracker.moodle.org/browse/MDL-60313

        Attachments

        1. diff.log
          5 kB
        2. Screenshot_1.jpg
          Screenshot_1.jpg
          111 kB
        3. Screenshot_2.jpg
          Screenshot_2.jpg
          38 kB

          Issue Links

            Activity

              People

              Assignee:
              ilyatregubov Ilya Tregubov
              Reporter:
              sarjona Sara Arjona (@sarjona)
              Peer reviewer:
              Carlos Escobedo
              Integrator:
              Jun Pataleta
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/May/21

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 18 minutes
                  1d 18m