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

Perf config #832

Closed
wants to merge 4 commits into from
Closed

Conversation

PraveenPenguin
Copy link
Collaborator

1-Added a library function which perf collection attribute set in HMC
2- Added Library which help to set value of perf collection via HMC
3-Added support in Machine config as perf collection data can be set via dynamic profile
4-Remove non-relevant function docstring

common/OpTestHMC.py Show resolved Hide resolved
common/OpTestHMC.py Outdated Show resolved Hide resolved
common/OpTestHMC.py Outdated Show resolved Hide resolved
@PraveenPenguin
Copy link
Collaborator Author

@abdhaleegit addressed review comment, please have a review

@abdhaleegit abdhaleegit self-requested a review May 2, 2024 04:47
Copy link
Collaborator

@abdhaleegit abdhaleegit left a comment

Choose a reason for hiding this comment

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

few more comments, rest all looks good

if perf_collection:
return True
else:
return False
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need of else here and also short name for variable perf_collection like rc

if rc:
    return True
return False

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks good will adopt

if self.cv_HMC.is_perfcollection_enabled:
log.info("System is already booted with perf collection profile enabled")
else:
return "Failed to boot perf collection profile enabled"
Copy link
Collaborator

Choose a reason for hiding this comment

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

return a string ? or this should be log.info ? or raise error

Copy link
Contributor

Choose a reason for hiding this comment

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

+1. Also the message string should be
"Failed to enable Performance Information collection"

Copy link
Collaborator Author

@PraveenPenguin PraveenPenguin May 3, 2024

Choose a reason for hiding this comment

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

Thanks Sachin, I will reword , @abdhaleegit @sacsant as we need to return statement with string as in caller we are making test fails with return string

log.info("System is already booted with perf collection profile enabled")
else:
self.cv_HMC.hmc_perfcollect_configure()
if self.cv_HMC.is_perfcollection_enabled:
Copy link
Contributor

Choose a reason for hiding this comment

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

since hmc_perfcollect_configure() returns a value, why not add a check for the same and avoid calling is_percollection_enabled() twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks sachin , earlier logic was not up to mark in OptestHMC.py to return so removed return statement from hmc_perfcollect_configure() , now we are good that calling is_percollection_enabled() return exact check

if "perf=1" in self.machine_config:
conf = OpTestConfiguration.conf
if self.cv_HMC.is_perfcollection_enabled():
log.info("System is already booted with perf collection profile enabled")
Copy link
Contributor

Choose a reason for hiding this comment

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

Better message will be
"Performance Information collection is already enabled"
or
"Performance Information Collection is active"

if self.cv_HMC.is_perfcollection_enabled:
log.info("System is already booted with perf collection profile enabled")
else:
return "Failed to boot perf collection profile enabled"
Copy link
Contributor

Choose a reason for hiding this comment

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

+1. Also the message string should be
"Failed to enable Performance Information collection"

@PraveenPenguin PraveenPenguin force-pushed the perf_config branch 3 times, most recently from b80b3d2 to c3fd861 Compare May 3, 2024 13:05
@PraveenPenguin
Copy link
Collaborator Author

@abdhaleegit @sacsant addressed review comment please have look

@abdhaleegit abdhaleegit self-assigned this May 6, 2024
Copy link
Collaborator

@abdhaleegit abdhaleegit left a comment

Choose a reason for hiding this comment

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

last comments


def is_perfcollection_enabled(self):
'''
Get pef collection allowed in hmc profile
Copy link
Collaborator

Choose a reason for hiding this comment

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

pef ?

Enable/Disable perfcollection from HMC
'''
# Set perf collection profile value using HMC command
cmd = ('chsyscfg -r lpar -m %s -i "name=%s, allow_perf_collection=' %
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is only one double qoute .. is this a typo ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes that is correct

2024-05-08 14:52:29,484:op-test.common.OpTestHMC:wait_lpar_state:INFO:Current state: Shutting Down
[console-expect]#lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F state
lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F state
Not Activated
[console-expect]#echo $?
echo $?
0
[console-expect]#lsrefcode -m system -r lpar --filter lpar_names=system-lp13-CR -F refcode
lsrefcode -m system -r lpar --filter lpar_names=system-lp13-CR -F refcode
00000000
[console-expect]#echo $?
echo $?
0
2024-05-08 14:52:44,765:op-test.common.OpTestHMC:wait_lpar_state:INFO:Current state: Not Activated
[console-expect]#lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F allow_perf_collection
lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F allow_perf_collection
1
[console-expect]#echo $?
echo $?
0
2024-05-08 14:52:59,910:op-test.testcases.MachineConfig:LparSetup:INFO:System is already booted with perf collection profile enabled
[console-expect]#lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F state
lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F state
Not Activated
[console-expect]#echo $?
echo $?
0
[console-expect]#lsrefcode -m system -r lpar --filter lpar_names=system-lp13-CR -F refcode
lsrefcode -m system -r lpar --filter lpar_names=system-lp13-CR -F refcode
00000000
[console-expect]#echo $?
echo $?
0
[console-expect]#lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F state
lssyscfg -m system -r lpar --filter lpar_names=system-lp13-CR -F state
Not Activated
[console-expect]#echo $?

(self.mg_system, self.lpar_name))
if enable: # Value '1' to enable perfcollection
cmd = '%s1"' % cmd
else: # Value '0' to disable perfcollection
Copy link
Collaborator

Choose a reason for hiding this comment

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

also documentation can be moved to method doc string

…on attribute set to LPAR profile

Added library function which retun True/False if performance collection attribute set to LPAR profile

Signed-off-by: Praveen K Pandey <[email protected]>
…to LPAR using HMC command

Added a library function which help to set perf collection attribute to LPAR using HMC command

Signed-off-by: Praveen K Pandey <[email protected]>
…a dynamic profile

Added support in Machine config as perf collection data can be set via dynamic profile

Signed-off-by: Praveen K Pandey <[email protected]>
Remove non relevant function docstring

Signed-off-by: Praveen K Pandey <[email protected]>
@PraveenPenguin
Copy link
Collaborator Author

@abdhaleegit thank you for taking time to review code changes , pushed changes , can you please review again

@@ -927,20 +927,20 @@ def is_perfcollection_enabled(self):
if rc:
return True
return False

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this additional commit? It changes the code(cosmetic changes) added by previous commit? Can we fold this into previous one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

as i was looking to add changes align with logging as changes , let me see if some thing messed up while , let me resend

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah.. you can just ammend the changes to same previous commit

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes closing this PR as have logic separation of commit as some while addressing review comment bank line goes as diffrent commit

@PraveenPenguin
Copy link
Collaborator Author

Closing this PR raised another PR #839

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.

3 participants