Skip to content

Add thread filtering support for gdb-oneapi callstack capture.#54

Open
abijaz wants to merge 1 commit intollnl:developfrom
abijaz:oneapi_gdb_upd
Open

Add thread filtering support for gdb-oneapi callstack capture.#54
abijaz wants to merge 1 commit intollnl:developfrom
abijaz:oneapi_gdb_upd

Conversation

@abijaz
Copy link
Contributor

@abijaz abijaz commented Feb 16, 2026

Add two new environment variables to control thread selection during callstack capture:

  • STAT_GDB_MAX_THREADS: Limit capture to first N threads
  • STAT_INTELGT_EXPR_FILTER: Filter threads using GDB expression

STAT_INTELGT_MAX_THREADS=100 will capture the first 100 threads.

STAT_INTELGT_EXPR_FILTER allows selective thread capture using GDB expressions (e.g., "$_thread <= 50" to capture only threads 1-50).

Updated documentation to describe both environment variables with usage examples.

IMPORTANT NOTE: Could not generated the PDF file for the PR to include the change in documentation following https://github.com/llnl/STAT/blob/develop/doc/src/README. It fails to generate a PDF file.

@lee218llnl
Copy link
Collaborator

I can't test the PR, but it looks OK to me.

Regarding documentation, can you send the output when you run the "doc/src/README" script and also the output of docbook2pdf --version? I'm on a RHEL8-based system, and here's what I see:

[lee218@dane5:src]$ ./README 
++ docbook2man stat_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/stat_man.sgml
++ docbook2man statgui_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/statgui_man.sgml
++ docbook2man statview_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/statview_man.sgml
++ docbook2man statbench_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/statbench_man.sgml
++ docbook2pdf stat_userguide.sgml -o ../userguide
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/stat_userguide.sgml
++ docbook2pdf stat_quickstart.sgml -o ../quickstart
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/stat_quickstart.sgml
++ docbook2html stat_userguide.sgml -o ../userguide/html
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#html
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/stat_userguide.sgml
++ docbook2txt INSTALL.sgml -o ../../
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#html
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/INSTALL.sgml
++ mv ../../INSTALL.txt ../../INSTALL
++ docbook2txt LICENSE.sgml -o ../../
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#html
Working on: /usr/workspace/lee218/delete/pull/stat/doc/src/LICENSE.sgml
++ mv ../../LICENSE.txt ../../LICENSE
[lee218@dane5:src]$ docbook2pdf --version
DocBook-utils version 0.6.14 (jw version 1.1)

@lee218llnl
Copy link
Collaborator

stat_userguide.pdf

If it helps, here's the generated PDF file.

My one request is for the documentation about STAT_INTELGT_EXPR_FILTER, please remove the single quotes for 'shell', 'call', etc. The markings should stand out enough and we don't single quote them in other parts of the documentation. Less importantly, in the "Security Note" perhaps shell, call, python should by highlighted like other commands.

@abijaz
Copy link
Contributor Author

abijaz commented Feb 16, 2026

stat_userguide.pdf

If it helps, here's the generated PDF file.

Thanks.

My one request is for the documentation about STAT_INTELGT_EXPR_FILTER, please remove the single quotes for 'shell', 'call', etc. The markings should stand out enough and we don't single quote them in other parts of the documentation. Less importantly, in the "Security Note" perhaps shell, call, python should by highlighted like other commands.

I will fix and update the PR. Kindly, please provide then the updated pdf again, I will then add it to PR also.

@abijaz
Copy link
Contributor Author

abijaz commented Feb 16, 2026

docbook2man statview_man.sgml -o ../../man

I am using Ubuntu 22 and might be this is the reason then. I see lot of warnings

$  docbook2pdf --version
DocBook-utils version 0.6.14 (jw version 1.1)

$ docbook2man stat_man.sgml -o ../../man
Using catalogs: /etc/sgml/catalog
Using stylesheet: /usr/share/docbook-utils/docbook-utils.dsl#print
Working on: /home/sources/STAT/STAT/doc/src/stat_man.sgml
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:5:13:E: character "_" invalid: only parameter literal, "CDATA", "ENDTAG", "MD", "MS", "PI", "PUBLIC", "SDATA", "STARTTAG", "SYSTEM" and parameter separators allowed
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:6:13:E: character "_" invalid: only parameter literal, "CDATA", "ENDTAG", "MD", "MS", "PI", "PUBLIC", "SDATA", "STARTTAG", "SYSTEM" and parameter separators allowed
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:7:13:E: character "_" invalid: only parameter literal, "CDATA", "ENDTAG", "MD", "MS", "PI", "PUBLIC", "SDATA", "STARTTAG", "SYSTEM" and parameter separators allowed
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:8:13:E: character "_" invalid: only parameter literal, "CDATA", "ENDTAG", "MD", "MS", "PI", "PUBLIC", "SDATA", "STARTTAG", "SYSTEM" and parameter separators allowed
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:47:5:W: cannot generate system identifier for general entity "stat"
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:47:5:E: general entity "stat" not defined and no default entity
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:47:9:E: reference to entity "stat" for which no system identifier could be generated
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:47:4: entity was defined here
onsgmls:/home/sources/STAT/STAT/doc/src/stat_man.sgml:47:9:E: character data is not allowed here

Add two new environment variables to control thread selection during
callstack capture:

- STAT_GDB_MAX_THREADS: Limit capture to first N threads
- STAT_INTELGT_EXPR_FILTER: Filter threads using GDB expression

STAT_INTELGT_MAX_THREADS=100 will capture the first 100 threads.

STAT_INTELGT_EXPR_FILTER allows selective thread capture using GDB
expressions (e.g., "\$_thread <= 50" to capture only threads 1-50).

Updated documentation to describe both environment variables with
usage examples.  The user guide pdf file is also regenerated accordingly.

Signed-off-by: Abdul Basit Ijaz <abdul.b.ijaz@intel.com>
@abijaz
Copy link
Contributor Author

abijaz commented Feb 17, 2026

@lee218llnl please review the latest changes to the pull request. The following updates have been made:

  1. Addressed all feedback related to the environment document file
  2. Successfully configured PDF generation on a RHEL8 system and hence included the user guide PDF file accordingly

The PDF generation logs are provided below:

+ docbook2man stat_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /home/STAT/doc/src/stat_man.sgml
+ docbook2man statgui_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /home/STAT/doc/src/statgui_man.sgml
+ docbook2man statview_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /home/STAT/doc/src/statview_man.sgml
+ docbook2man statbench_man.sgml -o ../../man
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /home/STAT/doc/src/statbench_man.sgml
+ docbook2pdf stat_userguide.sgml -o ../userguide
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /home/STAT/doc/src/stat_userguide.sgml
+ docbook2pdf stat_quickstart.sgml -o ../quickstart
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#print
Working on: /home/STAT/doc/src/stat_quickstart.sgml
+ docbook2html stat_userguide.sgml -o ../userguide/html
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#html
Working on: /home/STAT/doc/src/stat_userguide.sgml
+ docbook2txt INSTALL.sgml -o ../../
Using catalogs: /etc/sgml/sgml-docbook-4.1.cat
Using stylesheet: /usr/share/sgml/docbook/utils-0.6.14/docbook-utils.dsl#html
Working on: /home/STAT/doc/src/INSTALL.sgml
docbook2pdf --version
DocBook-utils version 0.6.14 (jw version 1.1)

@lee218llnl
Copy link
Collaborator

It looks like the docbook commands worked OK, so perhaps those are just warnings. Can you look in ../userguide to see if the PDF is there? For me here's what I see:

[lee218@dane5:src]$ pwd
/usr/workspace/lee218/delete/pull/stat/doc/src

[lee218@dane5:src]$ ls ../userguide/
html Makefile.am stat_userguide.pdf

If that isn't there, then perhaps they are true errors. It looks like it doesn't like underscores, such as "stat_options". Can I trouble you to try removing the "_" character and use camel case, for instance change "stat_options" to "statOptions". Be sure to change all references. I could do this myself, but I have no way of testing whether it helps in your case, as my system doesn't generate those errors.

@abijaz
Copy link
Contributor Author

abijaz commented Feb 18, 2026

It looks like the docbook commands worked OK, so perhaps those are just warnings. Can you look in ../userguide to see if the PDF is there? For me here's what I see:

It was not generated due to errors on Ubuntu 22 . But i was also able to generate it on RHEL8 without any additional changes.

If that isn't there, then perhaps they are true errors. It looks like it doesn't like underscores, such as "stat_options". Can I trouble you to try removing the "_" character and use camel case, for instance change "stat_options" to "statOptions".

Thanks for the pointer. Yes by replacing "_" character with camel case I was able to build it on Ubuntu22 also and then new user guide i verified was generated as expected. I can create a separate PR for it or shall I include all those changes in a separate commit in this same PR ?

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