-
Notifications
You must be signed in to change notification settings - Fork 85
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
Perf config #832
Conversation
a4e88bd
to
b455bc3
Compare
@abdhaleegit addressed review comment, please have a review |
There was a problem hiding this 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
common/OpTestHMC.py
Outdated
if perf_collection: | ||
return True | ||
else: | ||
return False |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good will adopt
testcases/MachineConfig.py
Outdated
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" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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"
testcases/MachineConfig.py
Outdated
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" |
There was a problem hiding this comment.
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"
b80b3d2
to
c3fd861
Compare
@abdhaleegit @sacsant addressed review comment please have look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last comments
common/OpTestHMC.py
Outdated
|
||
def is_perfcollection_enabled(self): | ||
''' | ||
Get pef collection allowed in hmc profile |
There was a problem hiding this comment.
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=' % |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 $?
common/OpTestHMC.py
Outdated
(self.mg_system, self.lpar_name)) | ||
if enable: # Value '1' to enable perfcollection | ||
cmd = '%s1"' % cmd | ||
else: # Value '0' to disable perfcollection |
There was a problem hiding this comment.
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 <praveen@linux.vnet.ibm.com>
…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 <praveen@linux.vnet.ibm.com>
…a dynamic profile Added support in Machine config as perf collection data can be set via dynamic profile Signed-off-by: Praveen K Pandey <praveen@linux.vnet.ibm.com>
Remove non relevant function docstring Signed-off-by: Praveen K Pandey <praveen@linux.vnet.ibm.com>
c3fd861
to
f595b2f
Compare
@abdhaleegit thank you for taking time to review code changes , pushed changes , can you please review again |
common/OpTestHMC.py
Outdated
@@ -927,20 +927,20 @@ def is_perfcollection_enabled(self): | |||
if rc: | |||
return True | |||
return False | |||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Closing this PR raised another PR #839 |
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