Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for gdb-oneapi #43

Merged
merged 2 commits into from
Jul 20, 2023
Merged

Conversation

moguzhankarakaya
Copy link
Contributor

Add a support to use gdb-oneapi backend along with some minor fixes.
Add a test suite for regexes used in oneapi-gdb.py.
Add a support to use core files with gdb-oneapi backend.

Several parts of the core_file_merger script had to
be tweaked to make it run on Ubuntu 20.04 + python3.8
without any fatal errors. Unclear if it affects other
debugger backends - seems so.

In the gdb script on resume function, after sending
continue command buffer is flushed to prevent deadlock.
For serial attach scenario deadlock was inevitable on
Ubuntu 20.04 + python3.8.

Co-authored-by: Oguzhan Karakaya <oguzhan.karakaya@intel.com>
Copy link
Collaborator

@lee218llnl lee218llnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test, please see comments in review

def parse_thread_info_line(line, parse_simd_lanes = False):
"""
Extracts thread IDs from a `thread info` output produced by
Intel® Distribution for GDB*. See oneapi_gdb_test.py for
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a huge deal, but when I run, I get a warning about a non-ascii character. I presume this is the R registered character. Can we change this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@moguzhankarakaya if you can please address my comment, then I can merge your PR. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced non-ascii ® with (R). 👍🏻

logging.info('GDB thread bt ID %d', thread_id)
ret = []

lines = self.communicate(f"thread apply {thread_id} bt")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I should deprecate Python 2 eventually, but I am not ready yet. In the meantime, this python 3 formatting string f" is causing warnings/errors:

invalid syntax (oneapi_gdb.py, line 172)

Can we revert this and other instances to the older string formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I can use older string formatting. I checked gdb.py and conformed the string formatting used there. In this case for example I changed
f"thread apply {thread_id} bt"
into
"thread apply %s bt" %thread_id

Corefile merger and generic gdb_oneapi driver is implemented.
Frame parser is pretified and function names are abbreviated
programmatically. Script "oneapi_gdb_test.py" is provided for
testing regex parser methotds implemented for the driver.

System test is done using stat serial attach mechanism.
After setting STAT_GDB environment variable as gdb_oneapi,
stat-cl -G -w -t 5 -I <PIDs to attach> can be run to generate
bt graph. Additionally, STATmain merge --oneapi -c /path/to/core
can be run to generate bt graph from core file.

Co-authored-by: Oguzhan Karakaya <oguzhan.karakaya@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants