Skip to content

Comments

Test PR – ThpPlugin (do not merge)#133

Draft
bargajda-amd wants to merge 3 commits intodevelopmentfrom
bargajda_cursor_test
Draft

Test PR – ThpPlugin (do not merge)#133
bargajda-amd wants to merge 3 commits intodevelopmentfrom
bargajda_cursor_test

Conversation

@bargajda-amd
Copy link
Collaborator

This pull request is not supposed to get merged — it's just a test.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@bargajda-amd
Copy link
Collaborator Author

Hi everyone, I am testing Cursor and figured it would be cool to make it create a new plugin and create a PR. Looks like it's done :) I don't want it to get merged though as the functionality of the plugin does not make too much sense. Don't delete the PR yet either. Thanks and sorry for messing up with you repo ;)

bargajda and others added 2 commits February 23, 2026 18:27
Copy link
Collaborator

@alexandraBara alexandraBara left a comment

Choose a reason for hiding this comment

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

Keep in mind that any new files added to the repo in the year of 2026 need to have the copyright at top of the file with the correct year. So 2025->2026 for new files.

Comment on lines +36 to +37
exp_enabled: Optional[str] = None # 'always', 'madvise', 'never'
exp_defrag: Optional[str] = None
Copy link
Collaborator

@alexandraBara alexandraBara Feb 23, 2026

Choose a reason for hiding this comment

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

this is a good start. We have discussed a plugin like this internally. We concluded that this plugin, ThpPlugin (which i think we can rename to something more generic like SysfsSettingsPugin ) should accommodate analyzer_args like these (example of plugin_config.json):

{
  "plugins": {
    "SysfsPlugin": {
      "analysis_args": {
        "checks": [
          {
            "path": "/sys/kernel/mm/transparent_hugepage/enabled",
            "expected": ["always", "[always]"],
            "name": "THP enabled"
          },
          {
            "path": "/sys/kernel/mm/transparent_hugepage/defrag",
            "expected": ["always", "[always]"],
            "name": "THP defrag"
          }
        ]
      }
    }
  }
}

notice that it allows for a list of paths, so not just "= "/sys/kernel/mm/transparent_hugepage"" -in the future we will need to check a lot more than just this setting. We also want to allow for the user to specify which, if any expected values for that setting, hence the expected can be a list, but empty list should also be accepted (for cases where we dont care what expected is, just that the path is there)

Comment on lines +35 to +37
THP_BASE = "/sys/kernel/mm/transparent_hugepage"
# Sysfs format: "[always] madvise never" -> extract bracketed value
BRACKETED_RE = re.compile(r"\[(\w+)\]")
Copy link
Collaborator

Choose a reason for hiding this comment

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

the cmd that is being run here should be:
CMD = "sys/{}" where the "{}" would be a compiled list of paths taken from the analyzer arg. Defining it with a variable like CMD or CMD_<> allows our automated doc generator to pick up this cmd and include it in the docs.

@alexandraBara alexandraBara marked this pull request as draft February 23, 2026 20:40
@alexandraBara
Copy link
Collaborator

Hi everyone, I am testing Cursor and figured it would be cool to make it create a new plugin and create a PR. Looks like it's done :) I don't want it to get merged though as the functionality of the plugin does not make too much sense. Don't delete the PR yet either. Thanks and sorry for messing up with you repo ;)

i turned it into a draft until its in better shape for review

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