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

PM: QoS: Simplify definitions of CPU latency QoS trace events

Modify the definitions of the CPU latency QoS trace events to take
one argument (since PM_QOS_CPU_DMA_LATENCY is always passed as the
pm_qos_class argument to them) and update the documentation of them
accordingly (while at it, make it explicitly mention CPU latency QoS
and relocate it after the device PM QoS trace events documentation).

The names and output format of the trace events do not change to
preserve user space compatibility.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Tested-by: Amit Kucheria <amit.kucheria@linaro.org>

+35 -35
+10 -9
Documentation/trace/events-power.rst
··· 75 75 target/flags update. 76 76 :: 77 77 78 - pm_qos_add_request "pm_qos_class=%s value=%d" 79 - pm_qos_update_request "pm_qos_class=%s value=%d" 80 - pm_qos_remove_request "pm_qos_class=%s value=%d" 81 - 82 - The first parameter gives the QoS class name (e.g. "CPU_DMA_LATENCY"). 83 - The second parameter is value to be added/updated/removed. 84 - :: 85 - 86 78 pm_qos_update_target "action=%s prev_value=%d curr_value=%d" 87 79 pm_qos_update_flags "action=%s prev_value=0x%x curr_value=0x%x" 88 80 ··· 82 90 The second parameter is the previous QoS value. 83 91 The third parameter is the current QoS value to update. 84 92 85 - And, there are also events used for device PM QoS add/update/remove request. 93 + There are also events used for device PM QoS add/update/remove request. 86 94 :: 87 95 88 96 dev_pm_qos_add_request "device=%s type=%s new_value=%d" ··· 93 101 QoS requests. 94 102 The second parameter gives the request type (e.g. "DEV_PM_QOS_RESUME_LATENCY"). 95 103 The third parameter is value to be added/updated/removed. 104 + 105 + And, there are events used for CPU latency QoS add/update/remove request. 106 + :: 107 + 108 + pm_qos_add_request "value=%d" 109 + pm_qos_update_request "value=%d" 110 + pm_qos_remove_request "value=%d" 111 + 112 + The parameter is the value to be added/updated/removed.
+17 -18
include/trace/events/power.h
··· 359 359 ); 360 360 361 361 /* 362 - * The pm qos events are used for pm qos update 362 + * CPU latency QoS events used for global CPU latency QoS list updates 363 363 */ 364 - DECLARE_EVENT_CLASS(pm_qos_request, 364 + DECLARE_EVENT_CLASS(cpu_latency_qos_request, 365 365 366 - TP_PROTO(int pm_qos_class, s32 value), 366 + TP_PROTO(s32 value), 367 367 368 - TP_ARGS(pm_qos_class, value), 368 + TP_ARGS(value), 369 369 370 370 TP_STRUCT__entry( 371 - __field( int, pm_qos_class ) 372 371 __field( s32, value ) 373 372 ), 374 373 375 374 TP_fast_assign( 376 - __entry->pm_qos_class = pm_qos_class; 377 375 __entry->value = value; 378 376 ), 379 377 380 - TP_printk("pm_qos_class=%s value=%d", 381 - __print_symbolic(__entry->pm_qos_class, 382 - { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" }), 378 + TP_printk("CPU_DMA_LATENCY value=%d", 383 379 __entry->value) 384 380 ); 385 381 386 - DEFINE_EVENT(pm_qos_request, pm_qos_add_request, 382 + DEFINE_EVENT(cpu_latency_qos_request, pm_qos_add_request, 387 383 388 - TP_PROTO(int pm_qos_class, s32 value), 384 + TP_PROTO(s32 value), 389 385 390 - TP_ARGS(pm_qos_class, value) 386 + TP_ARGS(value) 391 387 ); 392 388 393 - DEFINE_EVENT(pm_qos_request, pm_qos_update_request, 389 + DEFINE_EVENT(cpu_latency_qos_request, pm_qos_update_request, 394 390 395 - TP_PROTO(int pm_qos_class, s32 value), 391 + TP_PROTO(s32 value), 396 392 397 - TP_ARGS(pm_qos_class, value) 393 + TP_ARGS(value) 398 394 ); 399 395 400 - DEFINE_EVENT(pm_qos_request, pm_qos_remove_request, 396 + DEFINE_EVENT(cpu_latency_qos_request, pm_qos_remove_request, 401 397 402 - TP_PROTO(int pm_qos_class, s32 value), 398 + TP_PROTO(s32 value), 403 399 404 - TP_ARGS(pm_qos_class, value) 400 + TP_ARGS(value) 405 401 ); 406 402 403 + /* 404 + * General PM QoS events used for updates of PM QoS request lists 405 + */ 407 406 DECLARE_EVENT_CLASS(pm_qos_update, 408 407 409 408 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
+8 -8
kernel/power/qos.c
··· 247 247 } 248 248 EXPORT_SYMBOL_GPL(pm_qos_request_active); 249 249 250 - static void cpu_latency_qos_update(struct pm_qos_request *req, 251 - enum pm_qos_req_action action, s32 value) 250 + static void cpu_latency_qos_apply(struct pm_qos_request *req, 251 + enum pm_qos_req_action action, s32 value) 252 252 { 253 253 int ret = pm_qos_update_target(req->qos, &req->node, action, value); 254 254 if (ret > 0) ··· 278 278 return; 279 279 } 280 280 281 - trace_pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, value); 281 + trace_pm_qos_add_request(value); 282 282 283 283 req->qos = &cpu_latency_constraints; 284 - cpu_latency_qos_update(req, PM_QOS_ADD_REQ, value); 284 + cpu_latency_qos_apply(req, PM_QOS_ADD_REQ, value); 285 285 } 286 286 EXPORT_SYMBOL_GPL(pm_qos_add_request); 287 287 ··· 305 305 return; 306 306 } 307 307 308 - trace_pm_qos_update_request(PM_QOS_CPU_DMA_LATENCY, new_value); 308 + trace_pm_qos_update_request(new_value); 309 309 310 310 if (new_value == req->node.prio) 311 311 return; 312 312 313 - cpu_latency_qos_update(req, PM_QOS_UPDATE_REQ, new_value); 313 + cpu_latency_qos_apply(req, PM_QOS_UPDATE_REQ, new_value); 314 314 } 315 315 EXPORT_SYMBOL_GPL(pm_qos_update_request); 316 316 ··· 333 333 return; 334 334 } 335 335 336 - trace_pm_qos_remove_request(PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); 336 + trace_pm_qos_remove_request(PM_QOS_DEFAULT_VALUE); 337 337 338 - cpu_latency_qos_update(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); 338 + cpu_latency_qos_apply(req, PM_QOS_REMOVE_REQ, PM_QOS_DEFAULT_VALUE); 339 339 memset(req, 0, sizeof(*req)); 340 340 } 341 341 EXPORT_SYMBOL_GPL(pm_qos_remove_request);