mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	tools/power turbostat: Add Power Limit4 support
Add Power Limit4 support. Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
		
							parent
							
								
									6799ba84ca
								
							
						
					
					
						commit
						f52ba93190
					
				
					 2 changed files with 10 additions and 0 deletions
				
			
		| 
						 | 
					@ -310,6 +310,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Run Time Average Power Limiting (RAPL) Interface */
 | 
					/* Run Time Average Power Limiting (RAPL) Interface */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define MSR_VR_CURRENT_CONFIG	0x00000601
 | 
				
			||||||
#define MSR_RAPL_POWER_UNIT		0x00000606
 | 
					#define MSR_RAPL_POWER_UNIT		0x00000606
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MSR_PKG_POWER_LIMIT		0x00000610
 | 
					#define MSR_PKG_POWER_LIMIT		0x00000610
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4773,6 +4773,15 @@ int print_rapl(struct thread_data *t, struct core_data *c, struct pkg_data *p)
 | 
				
			||||||
			((msr >> 32) & 0x7FFF) * rapl_power_units,
 | 
								((msr >> 32) & 0x7FFF) * rapl_power_units,
 | 
				
			||||||
			(1.0 + (((msr >> 54) & 0x3) / 4.0)) * (1 << ((msr >> 49) & 0x1F)) * rapl_time_units,
 | 
								(1.0 + (((msr >> 54) & 0x3) / 4.0)) * (1 << ((msr >> 49) & 0x1F)) * rapl_time_units,
 | 
				
			||||||
			((msr >> 48) & 1) ? "EN" : "DIS");
 | 
								((msr >> 48) & 1) ? "EN" : "DIS");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if (get_msr(cpu, MSR_VR_CURRENT_CONFIG, &msr))
 | 
				
			||||||
 | 
								return -9;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							fprintf(outf, "cpu%d: MSR_VR_CURRENT_CONFIG: 0x%08llx\n", cpu, msr);
 | 
				
			||||||
 | 
							fprintf(outf, "cpu%d: PKG Limit #4: %f Watts (%slocked)\n",
 | 
				
			||||||
 | 
								cpu,
 | 
				
			||||||
 | 
								((msr >> 0) & 0x1FFF) * rapl_power_units,
 | 
				
			||||||
 | 
								(msr >> 31) & 1 ? "" : "UN");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (do_rapl & RAPL_DRAM_POWER_INFO) {
 | 
						if (do_rapl & RAPL_DRAM_POWER_INFO) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue