[sos-devel] Query about pmem.py

Bryn M. Reeves bmr at redhat.com
Tue Jul 21 13:12:24 UTC 2020


On Tue, Jul 21, 2020 at 05:57:25PM +0530, Brahadambal Srinivasan wrote:
> I wanted to know if we can somehow make arch-specific classes in the pmem.py plugin to sos. Currently it has Intel specific commands enabled which would throw an error in PowerPC architecture. 

You can enable plugins based on architecture by setting the 'architectures'
member of the plugin to a list of strings describing the allowed
architectures, e.g. ['x86_64', 'ppc.*'].

If you need more fine grained control within a plugin then you can use a
predicate to restrict specific file, command or other collection according
to platform:

  ppc_p = SoSPredicate(arch=['ppc.*'])
  self.add_cmd_output("ppc_only_command", pred=ppc_p)

And "ppc_only_command" will only execute if the runtime architecture matches.

Regards,
Bryn.




More information about the sos-devel mailing list