Page MenuHomePhabricator

[OpenMP] [OMPD] [5/6] Implementation of OMPD debugging library - libompd. gdb-plugin: A Plugin code to gdb to leverage libompd to provide debugging support.
Needs ReviewPublic

Authored by Vigneshbalu on Apr 9 2021, 5:27 AM.

Details

Summary

This is part of the review: https://reviews.llvm.org/D100181

This patch includes python based plugin code to gdb that enables gdb to support OpenMP specific debugging through OMPD.
Loading of this plugin causes a few new gdb commands to be added ("ompd icv", "ompd parallel", "ompd bt", etc). The invocation of these commands results in the OMPD APIs being invoked with the required arguments to provide the user the needed information.
The plugin code also includes basic wrapper implementations of the callback routines.
Other than these, a few unit tests are included to verify if the return codes of the OMPD APIs align with what is specified in the standard. (ompdAPITests.c)

Diff Detail

Event Timeline

Vigneshbalu created this revision.Apr 9 2021, 5:27 AM
Vigneshbalu requested review of this revision.Apr 9 2021, 5:27 AM
Herald added a project: Restricted Project. · View Herald Transcript
Vigneshbalu changed the visibility from "Public (No Login Required)" to "Vigneshbalu (Vignesh Balasubramanian)".Apr 9 2021, 7:55 AM
Vigneshbalu changed the visibility from "Vigneshbalu (Vignesh Balasubramanian)" to "Public (No Login Required)".Apr 11 2021, 9:48 AM

Rebasing the patch.

Rebasing the patch.

Vigneshbalu edited the summary of this revision. (Show Details)Aug 10 2021, 2:05 AM

Rebasing the patch.

Gentle Reminder. !

Gentle reminder, as it is one of the last two patches to complete OMPD.

hbae added a comment.Jan 28 2022, 7:29 PM

The change looks good in general.
I tested basic usage of the ompd plugin, and it seems to work fine as expected.
I encountered python-related build issues on some of my test systems (e.g., Ubuntu 18.04) which I cannot resolve by installing required python packages, so I wonder if we need to make this (ompd test infrastructure) an optional feature for those who are interested.

The change looks good in general.
I tested basic usage of the ompd plugin, and it seems to work fine as expected.
I encountered python-related build issues on some of my test systems (e.g., Ubuntu 18.04) which I cannot resolve by installing required python packages, so I wonder if we need to make this (ompd test infrastructure) an optional feature for those who are interested.

I will try to fix it by skipping the plugin build, if the build system is incompatible.
Please give me some time, I will revert with details.

Fixes the build failure because of python (pip).

Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2022, 3:02 AM

The change looks good in general.
I tested basic usage of the ompd plugin, and it seems to work fine as expected.
I encountered python-related build issues on some of my test systems (e.g., Ubuntu 18.04) which I cannot resolve by installing required python packages, so I wonder if we need to make this (ompd test infrastructure) an optional feature for those who are interested.

Ubuntu and debian have its own patch on python pip which was causing failure.
Made changes in CMake to pick proper flag depend upon distributions and pip versions.
Tested the same on debian, ubuntu (wiht 9.01 and 21+ pip versions), centos and rhel.

Gentle Reminder

koops added a subscriber: koops.Jun 15 2022, 10:11 PM

This looks good to me. Is there a particular version of gdb that this plugin depends on? I didn't see that documented.

Since, the gdb interface code is written in python. GDB that uses libompd should be built with python 3.5 or above.

This is captured in "gdb-plugin/README.txt" under "NOTES" Section.

dreachem accepted this revision.Jul 11 2022, 8:13 AM

LGTM.

This revision is now accepted and ready to land.Jul 11 2022, 8:13 AM
jdoerfert reopened this revision.Jul 14 2022, 12:40 PM

This caused additional and undisclosed dependences to python packages, e.g. setuptools.
Please introduce a check + message for those and avoid build errors if they are missing.

This revision is now accepted and ready to land.Jul 14 2022, 12:40 PM
jdoerfert requested changes to this revision.Mon, Jul 18, 11:10 AM
This revision now requires changes to proceed.Mon, Jul 18, 11:10 AM

Removing python packages dependencies.