ibm-power-utilities / powerpc-utils

Suite of utilities for Linux on Power systems
GNU General Public License v2.0
34 stars 55 forks source link

powerpc-utils/lparstat: Output of lparstat -E #76

Closed Likhitha26 closed 1 year ago

Likhitha26 commented 2 years ago

The output of lparstat command is not well formatted. It looks like:

System Configuration type=Dedicated mode=Capped smt=Off lcpu=6 mem=5679104 kB cpus=0 ent=6.00

---Actual--- -Normalized- %busy %idle Frequency %busy %idle


0.00 0.01 2.33GHz[ 80%] 0.00 0.01

There is no gap between the units GHz and value in frequency and also the values are not aligned properly.After the changes the output of lparstat is as below:

System Configuration type=Dedicated mode=Capped smt=8 lcpu=4 mem=40770944 kB cpus=0 ent=4.00

---Actual--- ---Normalized--- %busy %idle Frequency %busy %idle 0.00 0.03 2.29 GHz [100%] 0.00 0.03

Signed-off-by: Likhitha Korrapati likhitha@linux.ibm.com Reported-by: Shirisha Ganta shirisha.ganta1@ibm.com Reviewed-by: Brahadambal Srinivasan latha@linux.vnet.ibm.com

nathanlynch commented 2 years ago

Thanks for your PR!

But I'm not sure about this.

I'm not seeing much upside in merging this, unfortunately.

nathanlynch commented 2 years ago

Also I believe the use of tab characters isn't appropriate for alignment of the output, since how they are rendered will depend on the user's terminal settings.

Likhitha26 commented 2 years ago

I agree. Customers may be using these tools output in their automated code to make decisions. Tabs and spaces may mess up things based on what customer is using. I can work on the patch to avoid tabs, but do we want to still pursue this patch?

nathanlynch commented 2 years ago

Sorry, no, I don't see a reason other than preference to change the existing behavior, and IMO that's not enough justification. @tyreld thoughts?

tyreld commented 1 year ago

I see no justification to change the current formatting.