Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'pm-misc' and 'pm-tools'

Merge miscellaneous power management updates and cpupower utility
updates for 6.17-rc1:

- Update contact information in the PM ABI docs and maintainer
information in the power domains DT binding (Rafael Wysocki)

- Update PM header inclusions to follow the IWYU (Include What You Use)
principle (Andy Shevchenko)

- Add flags to specify power on attach/detach for PM domains, make the
driver core detach PM domains in device_unbind_cleanup(), and drop
the dev_pm_domain_detach() call from the platform bus type (Claudiu
Beznea)

- Improve Python binding's Makefile for cpupower (John B. Wyatt IV)

- Fix printing of CORE, CPU fields in cpupower-monitor (Gautham Shenoy)

* pm-misc:
PM: docs: Use my kernel.org address in ABI docs and DT bindings
driver core: platform: Drop dev_pm_domain_detach() call
PM: domains: Detach on device_unbind_cleanup()
PM: domains: Add flags to specify power on attach/detach
PM: Don't use "proxy" headers

* pm-tools:
cpupower: Improve Python binding's Makefile
pm: cpupower: Fix printing of CORE, CPU fields in cpupower-monitor
pm: cpupower: Fix the snapshot-order of tsc,mperf, clock in mperf_stop()

+79 -71
+17 -17
Documentation/ABI/testing/sysfs-devices-power
··· 1 1 What: /sys/devices/.../power/ 2 2 Date: January 2009 3 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 3 + Contact: Rafael J. Wysocki <rafael@kernel.org> 4 4 Description: 5 5 The /sys/devices/.../power directory contains attributes 6 6 allowing the user space to check and modify some power ··· 8 8 9 9 What: /sys/devices/.../power/wakeup 10 10 Date: January 2009 11 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 11 + Contact: Rafael J. Wysocki <rafael@kernel.org> 12 12 Description: 13 13 The /sys/devices/.../power/wakeup attribute allows the user 14 14 space to check if the device is enabled to wake up the system ··· 34 34 35 35 What: /sys/devices/.../power/control 36 36 Date: January 2009 37 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 37 + Contact: Rafael J. Wysocki <rafael@kernel.org> 38 38 Description: 39 39 The /sys/devices/.../power/control attribute allows the user 40 40 space to control the run-time power management of the device. ··· 53 53 54 54 What: /sys/devices/.../power/async 55 55 Date: January 2009 56 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 56 + Contact: Rafael J. Wysocki <rafael@kernel.org> 57 57 Description: 58 58 The /sys/devices/.../async attribute allows the user space to 59 59 enable or disable the device's suspend and resume callbacks to ··· 79 79 80 80 What: /sys/devices/.../power/wakeup_count 81 81 Date: September 2010 82 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 82 + Contact: Rafael J. Wysocki <rafael@kernel.org> 83 83 Description: 84 84 The /sys/devices/.../wakeup_count attribute contains the number 85 85 of signaled wakeup events associated with the device. This ··· 90 90 91 91 What: /sys/devices/.../power/wakeup_active_count 92 92 Date: September 2010 93 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 93 + Contact: Rafael J. Wysocki <rafael@kernel.org> 94 94 Description: 95 95 The /sys/devices/.../wakeup_active_count attribute contains the 96 96 number of times the processing of wakeup events associated with ··· 102 102 103 103 What: /sys/devices/.../power/wakeup_abort_count 104 104 Date: February 2012 105 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 105 + Contact: Rafael J. Wysocki <rafael@kernel.org> 106 106 Description: 107 107 The /sys/devices/.../wakeup_abort_count attribute contains the 108 108 number of times the processing of a wakeup event associated with ··· 114 114 115 115 What: /sys/devices/.../power/wakeup_expire_count 116 116 Date: February 2012 117 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 117 + Contact: Rafael J. Wysocki <rafael@kernel.org> 118 118 Description: 119 119 The /sys/devices/.../wakeup_expire_count attribute contains the 120 120 number of times a wakeup event associated with the device has ··· 126 126 127 127 What: /sys/devices/.../power/wakeup_active 128 128 Date: September 2010 129 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 129 + Contact: Rafael J. Wysocki <rafael@kernel.org> 130 130 Description: 131 131 The /sys/devices/.../wakeup_active attribute contains either 1, 132 132 or 0, depending on whether or not a wakeup event associated with ··· 138 138 139 139 What: /sys/devices/.../power/wakeup_total_time_ms 140 140 Date: September 2010 141 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 141 + Contact: Rafael J. Wysocki <rafael@kernel.org> 142 142 Description: 143 143 The /sys/devices/.../wakeup_total_time_ms attribute contains 144 144 the total time of processing wakeup events associated with the ··· 149 149 150 150 What: /sys/devices/.../power/wakeup_max_time_ms 151 151 Date: September 2010 152 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 152 + Contact: Rafael J. Wysocki <rafael@kernel.org> 153 153 Description: 154 154 The /sys/devices/.../wakeup_max_time_ms attribute contains 155 155 the maximum time of processing a single wakeup event associated ··· 161 161 162 162 What: /sys/devices/.../power/wakeup_last_time_ms 163 163 Date: September 2010 164 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 164 + Contact: Rafael J. Wysocki <rafael@kernel.org> 165 165 Description: 166 166 The /sys/devices/.../wakeup_last_time_ms attribute contains 167 167 the value of the monotonic clock corresponding to the time of ··· 173 173 174 174 What: /sys/devices/.../power/wakeup_prevent_sleep_time_ms 175 175 Date: February 2012 176 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 176 + Contact: Rafael J. Wysocki <rafael@kernel.org> 177 177 Description: 178 178 The /sys/devices/.../wakeup_prevent_sleep_time_ms attribute 179 179 contains the total time the device has been preventing ··· 203 203 204 204 What: /sys/devices/.../power/pm_qos_resume_latency_us 205 205 Date: March 2012 206 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 206 + Contact: Rafael J. Wysocki <rafael@kernel.org> 207 207 Description: 208 208 The /sys/devices/.../power/pm_qos_resume_latency_us attribute 209 209 contains the PM QoS resume latency limit for the given device, ··· 223 223 224 224 What: /sys/devices/.../power/pm_qos_latency_tolerance_us 225 225 Date: January 2014 226 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 226 + Contact: Rafael J. Wysocki <rafael@kernel.org> 227 227 Description: 228 228 The /sys/devices/.../power/pm_qos_latency_tolerance_us attribute 229 229 contains the PM QoS active state latency tolerance limit for the ··· 248 248 249 249 What: /sys/devices/.../power/pm_qos_no_power_off 250 250 Date: September 2012 251 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 251 + Contact: Rafael J. Wysocki <rafael@kernel.org> 252 252 Description: 253 253 The /sys/devices/.../power/pm_qos_no_power_off attribute 254 254 is used for manipulating the PM QoS "no power off" flag. If ··· 263 263 264 264 What: /sys/devices/.../power/runtime_status 265 265 Date: April 2010 266 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 266 + Contact: Rafael J. Wysocki <rafael@kernel.org> 267 267 Description: 268 268 The /sys/devices/.../power/runtime_status attribute contains 269 269 the current runtime PM status of the device, which may be
+13 -13
Documentation/ABI/testing/sysfs-power
··· 1 1 What: /sys/power/ 2 2 Date: August 2006 3 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 3 + Contact: Rafael J. Wysocki <rafael@kernel.org> 4 4 Description: 5 5 The /sys/power directory will contain files that will 6 6 provide a unified interface to the power management ··· 8 8 9 9 What: /sys/power/state 10 10 Date: November 2016 11 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 11 + Contact: Rafael J. Wysocki <rafael@kernel.org> 12 12 Description: 13 13 The /sys/power/state file controls system sleep states. 14 14 Reading from this file returns the available sleep state ··· 23 23 24 24 What: /sys/power/mem_sleep 25 25 Date: November 2016 26 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 26 + Contact: Rafael J. Wysocki <rafael@kernel.org> 27 27 Description: 28 28 The /sys/power/mem_sleep file controls the operating mode of 29 29 system suspend. Reading from it returns the available modes ··· 41 41 42 42 What: /sys/power/disk 43 43 Date: September 2006 44 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 44 + Contact: Rafael J. Wysocki <rafael@kernel.org> 45 45 Description: 46 46 The /sys/power/disk file controls the operating mode of the 47 47 suspend-to-disk mechanism. Reading from this file returns ··· 90 90 91 91 What: /sys/power/image_size 92 92 Date: August 2006 93 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 93 + Contact: Rafael J. Wysocki <rafael@kernel.org> 94 94 Description: 95 95 The /sys/power/image_size file controls the size of the image 96 96 created by the suspend-to-disk mechanism. It can be written a ··· 107 107 108 108 What: /sys/power/pm_trace 109 109 Date: August 2006 110 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 110 + Contact: Rafael J. Wysocki <rafael@kernel.org> 111 111 Description: 112 112 The /sys/power/pm_trace file controls the code which saves the 113 113 last PM event point in the RTC across reboots, so that you can ··· 156 156 157 157 What: /sys/power/pm_async 158 158 Date: January 2009 159 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 159 + Contact: Rafael J. Wysocki <rafael@kernel.org> 160 160 Description: 161 161 The /sys/power/pm_async file controls the switch allowing the 162 162 user space to enable or disable asynchronous suspend and resume ··· 169 169 170 170 What: /sys/power/wakeup_count 171 171 Date: July 2010 172 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 172 + Contact: Rafael J. Wysocki <rafael@kernel.org> 173 173 Description: 174 174 The /sys/power/wakeup_count file allows user space to put the 175 175 system into a sleep state while taking into account the ··· 184 184 185 185 What: /sys/power/reserved_size 186 186 Date: May 2011 187 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 187 + Contact: Rafael J. Wysocki <rafael@kernel.org> 188 188 Description: 189 189 The /sys/power/reserved_size file allows user space to control 190 190 the amount of memory reserved for allocations made by device ··· 198 198 199 199 What: /sys/power/autosleep 200 200 Date: April 2012 201 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 201 + Contact: Rafael J. Wysocki <rafael@kernel.org> 202 202 Description: 203 203 The /sys/power/autosleep file can be written one of the strings 204 204 returned by reads from /sys/power/state. If that happens, a ··· 215 215 216 216 What: /sys/power/wake_lock 217 217 Date: February 2012 218 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 218 + Contact: Rafael J. Wysocki <rafael@kernel.org> 219 219 Description: 220 220 The /sys/power/wake_lock file allows user space to create 221 221 wakeup source objects and activate them on demand (if one of ··· 242 242 243 243 What: /sys/power/wake_unlock 244 244 Date: February 2012 245 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 245 + Contact: Rafael J. Wysocki <rafael@kernel.org> 246 246 Description: 247 247 The /sys/power/wake_unlock file allows user space to deactivate 248 248 wakeup sources created with the help of /sys/power/wake_lock. ··· 283 283 284 284 What: /sys/power/pm_debug_messages 285 285 Date: July 2017 286 - Contact: Rafael J. Wysocki <rjw@rjwysocki.net> 286 + Contact: Rafael J. Wysocki <rafael@kernel.org> 287 287 Description: 288 288 The /sys/power/pm_debug_messages file controls the printing 289 289 of debug messages from the system suspend/hiberbation
+1 -1
Documentation/devicetree/bindings/power/power-domain.yaml
··· 7 7 title: Generic PM domains 8 8 9 9 maintainers: 10 - - Rafael J. Wysocki <rjw@rjwysocki.net> 10 + - Rafael J. Wysocki <rafael@kernel.org> 11 11 - Kevin Hilman <khilman@kernel.org> 12 12 - Ulf Hansson <ulf.hansson@linaro.org> 13 13
+2 -2
drivers/amba/bus.c
··· 138 138 void __iomem *tmp; 139 139 int i, ret; 140 140 141 - ret = dev_pm_domain_attach(&dev->dev, true); 141 + ret = dev_pm_domain_attach(&dev->dev, PD_FLAG_ATTACH_POWER_ON); 142 142 if (ret) { 143 143 dev_dbg(&dev->dev, "can't get PM domain: %d\n", ret); 144 144 goto err_out; ··· 291 291 if (ret < 0) 292 292 break; 293 293 294 - ret = dev_pm_domain_attach(dev, true); 294 + ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON); 295 295 if (ret) 296 296 break; 297 297
+1 -1
drivers/base/auxiliary.c
··· 217 217 struct auxiliary_device *auxdev = to_auxiliary_dev(dev); 218 218 int ret; 219 219 220 - ret = dev_pm_domain_attach(dev, true); 220 + ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON); 221 221 if (ret) { 222 222 dev_warn(dev, "Failed to attach to PM Domain : %d\n", ret); 223 223 return ret;
+2
drivers/base/dd.c
··· 25 25 #include <linux/kthread.h> 26 26 #include <linux/wait.h> 27 27 #include <linux/async.h> 28 + #include <linux/pm_domain.h> 28 29 #include <linux/pm_runtime.h> 29 30 #include <linux/pinctrl/devinfo.h> 30 31 #include <linux/slab.h> ··· 553 552 dev->dma_range_map = NULL; 554 553 device_set_driver(dev, NULL); 555 554 dev_set_drvdata(dev, NULL); 555 + dev_pm_domain_detach(dev, dev->power.detach_power_off); 556 556 if (dev->pm_domain && dev->pm_domain->dismiss) 557 557 dev->pm_domain->dismiss(dev); 558 558 pm_runtime_reinit(dev);
+3 -6
drivers/base/platform.c
··· 1396 1396 if (ret < 0) 1397 1397 return ret; 1398 1398 1399 - ret = dev_pm_domain_attach(_dev, true); 1399 + ret = dev_pm_domain_attach(_dev, PD_FLAG_ATTACH_POWER_ON | 1400 + PD_FLAG_DETACH_POWER_OFF); 1400 1401 if (ret) 1401 1402 goto out; 1402 1403 1403 - if (drv->probe) { 1404 + if (drv->probe) 1404 1405 ret = drv->probe(dev); 1405 - if (ret) 1406 - dev_pm_domain_detach(_dev, true); 1407 - } 1408 1406 1409 1407 out: 1410 1408 if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) { ··· 1420 1422 1421 1423 if (drv->remove) 1422 1424 drv->remove(dev); 1423 - dev_pm_domain_detach(_dev, true); 1424 1425 } 1425 1426 1426 1427 static void platform_shutdown(struct device *_dev)
+6 -3
drivers/base/power/common.c
··· 83 83 /** 84 84 * dev_pm_domain_attach - Attach a device to its PM domain. 85 85 * @dev: Device to attach. 86 - * @power_on: Used to indicate whether we should power on the device. 86 + * @flags: indicate whether we should power on/off the device on attach/detach 87 87 * 88 88 * The @dev may only be attached to a single PM domain. By iterating through 89 89 * the available alternatives we try to find a valid PM domain for the device. ··· 100 100 * Returns 0 on successfully attached PM domain, or when it is found that the 101 101 * device doesn't need a PM domain, else a negative error code. 102 102 */ 103 - int dev_pm_domain_attach(struct device *dev, bool power_on) 103 + int dev_pm_domain_attach(struct device *dev, u32 flags) 104 104 { 105 105 int ret; 106 106 107 107 if (dev->pm_domain) 108 108 return 0; 109 109 110 - ret = acpi_dev_pm_attach(dev, power_on); 110 + ret = acpi_dev_pm_attach(dev, !!(flags & PD_FLAG_ATTACH_POWER_ON)); 111 111 if (!ret) 112 112 ret = genpd_dev_pm_attach(dev); 113 + 114 + if (dev->pm_domain) 115 + dev->power.detach_power_off = !!(flags & PD_FLAG_DETACH_POWER_OFF); 113 116 114 117 return ret < 0 ? ret : 0; 115 118 }
+1 -1
drivers/clk/qcom/apcs-sdx55.c
··· 111 111 * driver, there seems to be no better place to do this. So do it here! 112 112 */ 113 113 cpu_dev = get_cpu_device(0); 114 - ret = dev_pm_domain_attach(cpu_dev, true); 114 + ret = dev_pm_domain_attach(cpu_dev, PD_FLAG_ATTACH_POWER_ON); 115 115 if (ret) { 116 116 dev_err_probe(dev, ret, "can't get PM domain: %d\n", ret); 117 117 goto err;
+1 -1
drivers/gpu/drm/display/drm_dp_aux_bus.c
··· 57 57 container_of(aux_ep, struct dp_aux_ep_device_with_data, aux_ep); 58 58 int ret; 59 59 60 - ret = dev_pm_domain_attach(dev, true); 60 + ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON); 61 61 if (ret) 62 62 return dev_err_probe(dev, ret, "Failed to attach to PM Domain\n"); 63 63
+1 -1
drivers/i2c/i2c-core-base.c
··· 573 573 goto err_clear_wakeup_irq; 574 574 575 575 do_power_on = !i2c_acpi_waive_d0_probe(dev); 576 - status = dev_pm_domain_attach(&client->dev, do_power_on); 576 + status = dev_pm_domain_attach(&client->dev, do_power_on ? PD_FLAG_ATTACH_POWER_ON : 0); 577 577 if (status) 578 578 goto err_clear_wakeup_irq; 579 579
+1 -1
drivers/mmc/core/sdio_bus.c
··· 161 161 if (!id) 162 162 return -ENODEV; 163 163 164 - ret = dev_pm_domain_attach(dev, false); 164 + ret = dev_pm_domain_attach(dev, 0); 165 165 if (ret) 166 166 return ret; 167 167
+1 -1
drivers/rpmsg/rpmsg_core.c
··· 479 479 struct rpmsg_endpoint *ept = NULL; 480 480 int err; 481 481 482 - err = dev_pm_domain_attach(dev, true); 482 + err = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON); 483 483 if (err) 484 484 goto out; 485 485
+1 -1
drivers/soundwire/bus_type.c
··· 101 101 /* 102 102 * attach to power domain but don't turn on (last arg) 103 103 */ 104 - ret = dev_pm_domain_attach(dev, false); 104 + ret = dev_pm_domain_attach(dev, 0); 105 105 if (ret) 106 106 return ret; 107 107
+1 -1
drivers/spi/spi.c
··· 427 427 if (spi->irq < 0) 428 428 spi->irq = 0; 429 429 430 - ret = dev_pm_domain_attach(dev, true); 430 + ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON); 431 431 if (ret) 432 432 return ret; 433 433
+1 -1
drivers/tty/serdev/core.c
··· 399 399 const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver); 400 400 int ret; 401 401 402 - ret = dev_pm_domain_attach(dev, true); 402 + ret = dev_pm_domain_attach(dev, PD_FLAG_ATTACH_POWER_ON); 403 403 if (ret) 404 404 return ret; 405 405
+9 -7
include/linux/pm.h
··· 8 8 #ifndef _LINUX_PM_H 9 9 #define _LINUX_PM_H 10 10 11 - #include <linux/export.h> 12 - #include <linux/list.h> 13 - #include <linux/workqueue.h> 14 - #include <linux/spinlock.h> 15 - #include <linux/wait.h> 16 - #include <linux/timer.h> 17 - #include <linux/hrtimer.h> 18 11 #include <linux/completion.h> 12 + #include <linux/export.h> 13 + #include <linux/hrtimer_types.h> 14 + #include <linux/mutex.h> 15 + #include <linux/spinlock.h> 16 + #include <linux/types.h> 17 + #include <linux/util_macros.h> 18 + #include <linux/wait.h> 19 + #include <linux/workqueue_types.h> 19 20 20 21 /* 21 22 * Callbacks for platform drivers to implement. ··· 722 721 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ 723 722 void (*set_latency_tolerance)(struct device *, s32); 724 723 struct dev_pm_qos *qos; 724 + bool detach_power_off:1; /* Owned by the driver core */ 725 725 }; 726 726 727 727 extern int dev_pm_get_subsys_data(struct device *dev);
+8 -2
include/linux/pm_domain.h
··· 36 36 * isn't specified, the index just follows the 37 37 * index for the attached PM domain. 38 38 * 39 + * PD_FLAG_ATTACH_POWER_ON: Power on the domain during attach. 40 + * 41 + * PD_FLAG_DETACH_POWER_OFF: Power off the domain during detach. 42 + * 39 43 */ 40 44 #define PD_FLAG_NO_DEV_LINK BIT(0) 41 45 #define PD_FLAG_DEV_LINK_ON BIT(1) 42 46 #define PD_FLAG_REQUIRED_OPP BIT(2) 47 + #define PD_FLAG_ATTACH_POWER_ON BIT(3) 48 + #define PD_FLAG_DETACH_POWER_OFF BIT(4) 43 49 44 50 struct dev_pm_domain_attach_data { 45 51 const char * const *pd_names; ··· 507 501 #endif /* CONFIG_PM_GENERIC_DOMAINS_OF */ 508 502 509 503 #ifdef CONFIG_PM 510 - int dev_pm_domain_attach(struct device *dev, bool power_on); 504 + int dev_pm_domain_attach(struct device *dev, u32 flags); 511 505 struct device *dev_pm_domain_attach_by_id(struct device *dev, 512 506 unsigned int index); 513 507 struct device *dev_pm_domain_attach_by_name(struct device *dev, ··· 524 518 void dev_pm_domain_set(struct device *dev, struct dev_pm_domain *pd); 525 519 int dev_pm_domain_set_performance_state(struct device *dev, unsigned int state); 526 520 #else 527 - static inline int dev_pm_domain_attach(struct device *dev, bool power_on) 521 + static inline int dev_pm_domain_attach(struct device *dev, u32 flags) 528 522 { 529 523 return 0; 530 524 }
+7 -5
tools/power/cpupower/bindings/python/Makefile
··· 4 4 # This Makefile expects you have already run `make install-lib` in the lib 5 5 # directory for the bindings to be created. 6 6 7 - CC := gcc 7 + CC ?= gcc 8 + # CFLAGS ?= 9 + LDFLAGS ?= -lcpupower 8 10 HAVE_SWIG := $(shell if which swig >/dev/null 2>&1; then echo 1; else echo 0; fi) 9 11 HAVE_PYCONFIG := $(shell if which python-config >/dev/null 2>&1; then echo 1; else echo 0; fi) 10 12 11 - PY_INCLUDE = $(firstword $(shell python-config --includes)) 12 - INSTALL_DIR = $(shell python3 -c "import site; print(site.getsitepackages()[0])") 13 + PY_INCLUDE ?= $(firstword $(shell python-config --includes)) 14 + INSTALL_DIR ?= $(shell python3 -c "import site; print(site.getsitepackages()[0])") 13 15 14 16 all: _raw_pylibcpupower.so 15 17 16 18 _raw_pylibcpupower.so: raw_pylibcpupower_wrap.o 17 - $(CC) -shared -lcpupower raw_pylibcpupower_wrap.o -o _raw_pylibcpupower.so 19 + $(CC) -shared $(LDFLAGS) raw_pylibcpupower_wrap.o -o _raw_pylibcpupower.so 18 20 19 21 raw_pylibcpupower_wrap.o: raw_pylibcpupower_wrap.c 20 - $(CC) -fPIC -c raw_pylibcpupower_wrap.c $(PY_INCLUDE) 22 + $(CC) $(CFLAGS) $(PY_INCLUDE) -fPIC -c raw_pylibcpupower_wrap.c 21 23 22 24 raw_pylibcpupower_wrap.c: raw_pylibcpupower.swg 23 25 ifeq ($(HAVE_SWIG),0)
-4
tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
··· 121 121 switch (topology_depth) { 122 122 case TOPOLOGY_DEPTH_PKG: 123 123 printf(" PKG|"); 124 - break; 125 124 case TOPOLOGY_DEPTH_CORE: 126 125 printf("CORE|"); 127 - break; 128 126 case TOPOLOGY_DEPTH_CPU: 129 127 printf(" CPU|"); 130 128 break; ··· 165 167 switch (topology_depth) { 166 168 case TOPOLOGY_DEPTH_PKG: 167 169 printf("%4d|", cpu_top.core_info[cpu].pkg); 168 - break; 169 170 case TOPOLOGY_DEPTH_CORE: 170 171 printf("%4d|", cpu_top.core_info[cpu].core); 171 - break; 172 172 case TOPOLOGY_DEPTH_CPU: 173 173 printf("%4d|", cpu_top.core_info[cpu].cpu); 174 174 break;
+2 -2
tools/power/cpupower/utils/idle_monitor/mperf_monitor.c
··· 240 240 int cpu; 241 241 242 242 for (cpu = 0; cpu < cpu_count; cpu++) { 243 - mperf_measure_stats(cpu); 244 - mperf_get_tsc(&tsc_at_measure_end[cpu]); 245 243 clock_gettime(CLOCK_REALTIME, &time_end[cpu]); 244 + mperf_get_tsc(&tsc_at_measure_end[cpu]); 245 + mperf_measure_stats(cpu); 246 246 } 247 247 248 248 return 0;