Skip to content

Conversation

@oI0ck
Copy link
Member

@oI0ck oI0ck commented Dec 8, 2025

JIRA: RTOS-1187

@gemini-code-assist
Copy link

Summary of Changes

Hello @oI0ck, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the documentation for the syscalls_threadGetInfo function within the kernel. It clarifies the function's parameters and introduces a comprehensive set of flags that allow users to precisely specify which thread attributes they wish to retrieve, or to query information about multiple threads or the total thread count. This update aims to improve the clarity and usability of the kernel's thread information syscalls for developers.

Highlights

  • Documentation Update: The documentation for the syscalls_threadGetInfo function has been significantly expanded to provide a clearer understanding of its usage and capabilities.
  • New Parameters Detailed: The updated documentation now thoroughly explains the tid, flags, and n parameters, which were previously less detailed.
  • Granular Information Retrieval: A comprehensive set of PH_THREADINFO_* flags has been documented, allowing users to specify exactly which thread attributes (e.g., TID, priority, state, CPU time, name) they wish to retrieve.
  • Querying Multiple Threads and Thread Count: New capabilities for querying information about all threads (PH_THREADINFO_THREADS_ALL) and obtaining the total number of active threads (PH_THREADINFO_OPT_THREADCOUNT) are now documented.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly improves the documentation for the syscalls_threadGetInfo function by detailing its new parameters and flags. The added information is comprehensive and very helpful. I've made a few suggestions to improve grammar and clarity in the new documentation text. Overall, this is a great update.

Comment on lines 49 to 50
In this mode, `info` is treated as an array of `threadinfo_t`, with amount of element
specified in `n`. Otherwise, `n` must be set to 1.

Choose a reason for hiding this comment

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

medium

The phrase 'amount of element' is grammatically incorrect. For clarity, it should be 'the number of elements'.

Suggested change
In this mode, `info` is treated as an array of `threadinfo_t`, with amount of element
specified in `n`. Otherwise, `n` must be set to 1.
In this mode, `info` is treated as an array of `threadinfo_t`, with the number of elements
specified in `n`. Otherwise, `n` must be set to 1.


- `PH_THREADINFO_NAME`

Returns threads name in `info.name`.

Choose a reason for hiding this comment

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

medium

For grammatical correctness, 'threads name' should be the possessive 'thread's name'.

Suggested change
Returns threads name in `info.name`.
Returns thread's name in `info.name`.


Returns threads name in `info.name`.

The actual length of threads name can be arbitrarily long, however, the returned

Choose a reason for hiding this comment

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

medium

For grammatical correctness and clarity, 'threads name' should be 'the thread's name'.

Suggested change
The actual length of threads name can be arbitrarily long, however, the returned
The actual length of the thread's name can be arbitrarily long, however, the returned


- `PH_THREADINFO_VMEM`

Returns amount of mapped virtual memory in queried thread in `info.vmem`.

Choose a reason for hiding this comment

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

medium

To improve clarity, I suggest rephrasing this sentence. Using 'the amount of' is more specific, and 'for the queried thread' sounds more natural than 'in queried thread'.

Suggested change
Returns amount of mapped virtual memory in queried thread in `info.vmem`.
Returns the amount of mapped virtual memory for the queried thread in `info.vmem`.


- `PH_THREADINFO_ALL`

Returns all queriable attributes

Choose a reason for hiding this comment

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

medium

This description is a bit brief and ends abruptly. It would be clearer as a complete sentence. Also, 'queryable' is the more common spelling for 'queriable'.

Suggested change
Returns all queriable attributes
Returns all queryable attributes.

Comment on lines +98 to +101
Causes `threadsinfo` to ignore arguments `n` and `info`, as well as rest of
`flags` bits and returns amount of present threads in the system at the time
of invocation in `threadsinfo` return value.

Choose a reason for hiding this comment

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

medium

This paragraph has some grammatical items that make it a bit hard to read. I'd suggest rephrasing it for clarity and correctness.

Suggested change
Causes `threadsinfo` to ignore arguments `n` and `info`, as well as rest of
`flags` bits and returns amount of present threads in the system at the time
of invocation in `threadsinfo` return value.
Causes `threadsinfo` to ignore the `n` and `info` arguments, as well as the rest of
the `flags` bits. It then returns the number of threads present in the system at the time
of invocation as its return value.

@oI0ck oI0ck force-pushed the michal.lach/threadsinfo branch from 01da87a to 2ee4225 Compare December 8, 2025 18:28
@oI0ck oI0ck force-pushed the michal.lach/threadsinfo branch from 2ee4225 to 1c7cc54 Compare December 9, 2025 20:36
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