Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
[CPUFREQ] Remove pointless printk from p4-clockmod.
[CPUFREQ] Fix section mismatch for powernow_cpu_init in powernow-k7.c
[CPUFREQ] Fix section mismatch for longhaul_cpu_init.
[CPUFREQ] Fix section mismatch for longrun_cpu_init.
[CPUFREQ] powernow-k8: Fix misleading variable naming
[CPUFREQ] Convert pci_table entries to PCI_VDEVICE (if PCI_ANY_ID is used)
[CPUFREQ] arch/x86/kernel/cpu/cpufreq: use for_each_pci_dev()
[CPUFREQ] fix brace coding style issue.
[CPUFREQ] x86 cpufreq: Make trace_power_frequency cpufreq driver independent
[CPUFREQ] acpi-cpufreq: Fix CPU_ANY CPUFREQ_{PRE,POST}CHANGE notification
[CPUFREQ] ondemand: don't synchronize sample rate unless multiple cpus present
[CPUFREQ] unexport (un)lock_policy_rwsem* functions
[CPUFREQ] ondemand: Refactor frequency increase code
[CPUFREQ] powernow-k8: On load failure, remind the user to enable support in BIOS setup
[CPUFREQ] powernow-k8: Limit Pstate transition latency check
[CPUFREQ] Fix PCC driver error path
[CPUFREQ] fix double freeing in error path of pcc-cpufreq
[CPUFREQ] pcc driver should check for pcch method before calling _OSC
[CPUFREQ] fix memory leak in cpufreq_add_dev
[CPUFREQ] revert "[CPUFREQ] remove rwsem lock from CPUFREQ_GOV_STOP call (second call site)"

Manually fix up non-data merge conflict introduced by new calling
conventions for trace_power_start() in commit 6f4f2723d085 ("x86
cpufreq: Make trace_power_frequency cpufreq driver independent"), which
didn't update the intel_idle native hardware cpuidle driver.

+88 -105
-10
Documentation/feature-removal-schedule.txt
··· 377 377 378 378 ---------------------------- 379 379 380 - What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be 381 - exported interface anymore. 382 - When: 2.6.33 383 - Why: cpu_policy_rwsem has a new cleaner definition making it local to 384 - cpufreq core and contained inside cpufreq.c. Other dependent 385 - drivers should not use it in order to safely avoid lockdep issues. 386 - Who: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> 387 - 388 - ---------------------------- 389 - 390 380 What: sound-slot/service-* module aliases and related clutters in 391 381 sound/sound_core.c 392 382 When: August 2010
+2 -5
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
··· 34 34 #include <linux/compiler.h> 35 35 #include <linux/dmi.h> 36 36 #include <linux/slab.h> 37 - #include <trace/events/power.h> 38 37 39 38 #include <linux/acpi.h> 40 39 #include <linux/io.h> ··· 323 324 } 324 325 } 325 326 326 - trace_power_frequency(POWER_PSTATE, data->freq_table[next_state].frequency); 327 - 328 327 switch (data->cpu_feature) { 329 328 case SYSTEM_INTEL_MSR_CAPABLE: 330 329 cmd.type = SYSTEM_INTEL_MSR_CAPABLE; ··· 348 351 349 352 freqs.old = perf->states[perf->state].core_frequency * 1000; 350 353 freqs.new = data->freq_table[next_state].frequency; 351 - for_each_cpu(i, cmd.mask) { 354 + for_each_cpu(i, policy->cpus) { 352 355 freqs.cpu = i; 353 356 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 354 357 } ··· 364 367 } 365 368 } 366 369 367 - for_each_cpu(i, cmd.mask) { 370 + for_each_cpu(i, policy->cpus) { 368 371 freqs.cpu = i; 369 372 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 370 373 }
+4 -7
arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
··· 169 169 * Low Level chipset interface * 170 170 ****************************************************************/ 171 171 static struct pci_device_id gx_chipset_tbl[] __initdata = { 172 - { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, 173 - PCI_ANY_ID, PCI_ANY_ID }, 174 - { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520, 175 - PCI_ANY_ID, PCI_ANY_ID }, 176 - { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510, 177 - PCI_ANY_ID, PCI_ANY_ID }, 172 + { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY), }, 173 + { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5520), }, 174 + { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5510), }, 178 175 { 0, }, 179 176 }; 180 177 ··· 196 199 } 197 200 198 201 /* detect which companion chip is used */ 199 - while ((gx_pci = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, gx_pci)) != NULL) { 202 + for_each_pci_dev(gx_pci) { 200 203 if ((pci_match_id(gx_chipset_tbl, gx_pci)) != NULL) 201 204 return gx_pci; 202 205 }
+3 -3
arch/x86/kernel/cpu/cpufreq/longhaul.c
··· 426 426 } 427 427 428 428 429 - static int __init longhaul_get_ranges(void) 429 + static int __cpuinit longhaul_get_ranges(void) 430 430 { 431 431 unsigned int i, j, k = 0; 432 432 unsigned int ratio; ··· 530 530 } 531 531 532 532 533 - static void __init longhaul_setup_voltagescaling(void) 533 + static void __cpuinit longhaul_setup_voltagescaling(void) 534 534 { 535 535 union msr_longhaul longhaul; 536 536 struct mV_pos minvid, maxvid, vid; ··· 784 784 return 0; 785 785 } 786 786 787 - static int __init longhaul_cpu_init(struct cpufreq_policy *policy) 787 + static int __cpuinit longhaul_cpu_init(struct cpufreq_policy *policy) 788 788 { 789 789 struct cpuinfo_x86 *c = &cpu_data(0); 790 790 char *cpuname = NULL;
+13 -13
arch/x86/kernel/cpu/cpufreq/longhaul.h
··· 56 56 /* 57 57 * VIA C3 Samuel 1 & Samuel 2 (stepping 0) 58 58 */ 59 - static const int __initdata samuel1_mults[16] = { 59 + static const int __cpuinitdata samuel1_mults[16] = { 60 60 -1, /* 0000 -> RESERVED */ 61 61 30, /* 0001 -> 3.0x */ 62 62 40, /* 0010 -> 4.0x */ ··· 75 75 -1, /* 1111 -> RESERVED */ 76 76 }; 77 77 78 - static const int __initdata samuel1_eblcr[16] = { 78 + static const int __cpuinitdata samuel1_eblcr[16] = { 79 79 50, /* 0000 -> RESERVED */ 80 80 30, /* 0001 -> 3.0x */ 81 81 40, /* 0010 -> 4.0x */ ··· 97 97 /* 98 98 * VIA C3 Samuel2 Stepping 1->15 99 99 */ 100 - static const int __initdata samuel2_eblcr[16] = { 100 + static const int __cpuinitdata samuel2_eblcr[16] = { 101 101 50, /* 0000 -> 5.0x */ 102 102 30, /* 0001 -> 3.0x */ 103 103 40, /* 0010 -> 4.0x */ ··· 119 119 /* 120 120 * VIA C3 Ezra 121 121 */ 122 - static const int __initdata ezra_mults[16] = { 122 + static const int __cpuinitdata ezra_mults[16] = { 123 123 100, /* 0000 -> 10.0x */ 124 124 30, /* 0001 -> 3.0x */ 125 125 40, /* 0010 -> 4.0x */ ··· 138 138 120, /* 1111 -> 12.0x */ 139 139 }; 140 140 141 - static const int __initdata ezra_eblcr[16] = { 141 + static const int __cpuinitdata ezra_eblcr[16] = { 142 142 50, /* 0000 -> 5.0x */ 143 143 30, /* 0001 -> 3.0x */ 144 144 40, /* 0010 -> 4.0x */ ··· 160 160 /* 161 161 * VIA C3 (Ezra-T) [C5M]. 162 162 */ 163 - static const int __initdata ezrat_mults[32] = { 163 + static const int __cpuinitdata ezrat_mults[32] = { 164 164 100, /* 0000 -> 10.0x */ 165 165 30, /* 0001 -> 3.0x */ 166 166 40, /* 0010 -> 4.0x */ ··· 196 196 -1, /* 1111 -> RESERVED (12.0x) */ 197 197 }; 198 198 199 - static const int __initdata ezrat_eblcr[32] = { 199 + static const int __cpuinitdata ezrat_eblcr[32] = { 200 200 50, /* 0000 -> 5.0x */ 201 201 30, /* 0001 -> 3.0x */ 202 202 40, /* 0010 -> 4.0x */ ··· 235 235 /* 236 236 * VIA C3 Nehemiah */ 237 237 238 - static const int __initdata nehemiah_mults[32] = { 238 + static const int __cpuinitdata nehemiah_mults[32] = { 239 239 100, /* 0000 -> 10.0x */ 240 240 -1, /* 0001 -> 16.0x */ 241 241 40, /* 0010 -> 4.0x */ ··· 270 270 -1, /* 1111 -> 12.0x */ 271 271 }; 272 272 273 - static const int __initdata nehemiah_eblcr[32] = { 273 + static const int __cpuinitdata nehemiah_eblcr[32] = { 274 274 50, /* 0000 -> 5.0x */ 275 275 160, /* 0001 -> 16.0x */ 276 276 40, /* 0010 -> 4.0x */ ··· 315 315 unsigned short pos; 316 316 }; 317 317 318 - static const struct mV_pos __initdata vrm85_mV[32] = { 318 + static const struct mV_pos __cpuinitdata vrm85_mV[32] = { 319 319 {1250, 8}, {1200, 6}, {1150, 4}, {1100, 2}, 320 320 {1050, 0}, {1800, 30}, {1750, 28}, {1700, 26}, 321 321 {1650, 24}, {1600, 22}, {1550, 20}, {1500, 18}, ··· 326 326 {1475, 17}, {1425, 15}, {1375, 13}, {1325, 11} 327 327 }; 328 328 329 - static const unsigned char __initdata mV_vrm85[32] = { 329 + static const unsigned char __cpuinitdata mV_vrm85[32] = { 330 330 0x04, 0x14, 0x03, 0x13, 0x02, 0x12, 0x01, 0x11, 331 331 0x00, 0x10, 0x0f, 0x1f, 0x0e, 0x1e, 0x0d, 0x1d, 332 332 0x0c, 0x1c, 0x0b, 0x1b, 0x0a, 0x1a, 0x09, 0x19, 333 333 0x08, 0x18, 0x07, 0x17, 0x06, 0x16, 0x05, 0x15 334 334 }; 335 335 336 - static const struct mV_pos __initdata mobilevrm_mV[32] = { 336 + static const struct mV_pos __cpuinitdata mobilevrm_mV[32] = { 337 337 {1750, 31}, {1700, 30}, {1650, 29}, {1600, 28}, 338 338 {1550, 27}, {1500, 26}, {1450, 25}, {1400, 24}, 339 339 {1350, 23}, {1300, 22}, {1250, 21}, {1200, 20}, ··· 344 344 {675, 3}, {650, 2}, {625, 1}, {600, 0} 345 345 }; 346 346 347 - static const unsigned char __initdata mV_mobilevrm[32] = { 347 + static const unsigned char __cpuinitdata mV_mobilevrm[32] = { 348 348 0x1f, 0x1e, 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 349 349 0x17, 0x16, 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 350 350 0x0f, 0x0e, 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08,
+3 -3
arch/x86/kernel/cpu/cpufreq/longrun.c
··· 165 165 * TMTA rules: 166 166 * performance_pctg = (target_freq - low_freq)/(high_freq - low_freq) 167 167 */ 168 - static unsigned int __init longrun_determine_freqs(unsigned int *low_freq, 169 - unsigned int *high_freq) 168 + static unsigned int __cpuinit longrun_determine_freqs(unsigned int *low_freq, 169 + unsigned int *high_freq) 170 170 { 171 171 u32 msr_lo, msr_hi; 172 172 u32 save_lo, save_hi; ··· 258 258 } 259 259 260 260 261 - static int __init longrun_cpu_init(struct cpufreq_policy *policy) 261 + static int __cpuinit longrun_cpu_init(struct cpufreq_policy *policy) 262 262 { 263 263 int result = 0; 264 264
+1 -6
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
··· 178 178 } 179 179 } 180 180 181 - if (c->x86 != 0xF) { 182 - if (!cpu_has(c, X86_FEATURE_EST)) 183 - printk(KERN_WARNING PFX "Unknown CPU. " 184 - "Please send an e-mail to " 185 - "<cpufreq@vger.kernel.org>\n"); 181 + if (c->x86 != 0xF) 186 182 return 0; 187 - } 188 183 189 184 /* on P-4s, the TSC runs with constant frequency independent whether 190 185 * throttling is active or not. */
+4 -4
arch/x86/kernel/cpu/cpufreq/powernow-k7.c
··· 569 569 * We will then get the same kind of behaviour already tested under 570 570 * the "well-known" other OS. 571 571 */ 572 - static int __init fixup_sgtc(void) 572 + static int __cpuinit fixup_sgtc(void) 573 573 { 574 574 unsigned int sgtc; 575 575 unsigned int m; ··· 603 603 } 604 604 605 605 606 - static int __init acer_cpufreq_pst(const struct dmi_system_id *d) 606 + static int __cpuinit acer_cpufreq_pst(const struct dmi_system_id *d) 607 607 { 608 608 printk(KERN_WARNING PFX 609 609 "%s laptop with broken PST tables in BIOS detected.\n", ··· 621 621 * A BIOS update is all that can save them. 622 622 * Mention this, and disable cpufreq. 623 623 */ 624 - static struct dmi_system_id __initdata powernow_dmi_table[] = { 624 + static struct dmi_system_id __cpuinitdata powernow_dmi_table[] = { 625 625 { 626 626 .callback = acer_cpufreq_pst, 627 627 .ident = "Acer Aspire", ··· 633 633 { } 634 634 }; 635 635 636 - static int __init powernow_cpu_init(struct cpufreq_policy *policy) 636 + static int __cpuinit powernow_cpu_init(struct cpufreq_policy *policy) 637 637 { 638 638 union msr_fidvidstatus fidvidstatus; 639 639 int result;
+4 -2
arch/x86/kernel/cpu/cpufreq/powernow-k8.c
··· 806 806 * www.amd.com 807 807 */ 808 808 printk(KERN_ERR FW_BUG PFX "No PSB or ACPI _PSS objects\n"); 809 + printk(KERN_ERR PFX "Make sure that your BIOS is up to date" 810 + " and Cool'N'Quiet support is enabled in BIOS setup\n"); 809 811 return -ENODEV; 810 812 } 811 813 ··· 912 910 { 913 911 int i; 914 912 u32 hi = 0, lo = 0; 915 - rdmsr(MSR_PSTATE_CUR_LIMIT, hi, lo); 916 - data->max_hw_pstate = (hi & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT; 913 + rdmsr(MSR_PSTATE_CUR_LIMIT, lo, hi); 914 + data->max_hw_pstate = (lo & HW_PSTATE_MAX_MASK) >> HW_PSTATE_MAX_SHIFT; 917 915 918 916 for (i = 0; i < data->acpi_data.state_count; i++) { 919 917 u32 index;
+4 -4
arch/x86/kernel/process.c
··· 372 372 void default_idle(void) 373 373 { 374 374 if (hlt_use_halt()) { 375 - trace_power_start(POWER_CSTATE, 1); 375 + trace_power_start(POWER_CSTATE, 1, smp_processor_id()); 376 376 current_thread_info()->status &= ~TS_POLLING; 377 377 /* 378 378 * TS_POLLING-cleared state must be visible before we ··· 442 442 */ 443 443 void mwait_idle_with_hints(unsigned long ax, unsigned long cx) 444 444 { 445 - trace_power_start(POWER_CSTATE, (ax>>4)+1); 445 + trace_power_start(POWER_CSTATE, (ax>>4)+1, smp_processor_id()); 446 446 if (!need_resched()) { 447 447 if (cpu_has(&current_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) 448 448 clflush((void *)&current_thread_info()->flags); ··· 458 458 static void mwait_idle(void) 459 459 { 460 460 if (!need_resched()) { 461 - trace_power_start(POWER_CSTATE, 1); 461 + trace_power_start(POWER_CSTATE, 1, smp_processor_id()); 462 462 if (cpu_has(&current_cpu_data, X86_FEATURE_CLFLUSH_MONITOR)) 463 463 clflush((void *)&current_thread_info()->flags); 464 464 ··· 479 479 */ 480 480 static void poll_idle(void) 481 481 { 482 - trace_power_start(POWER_CSTATE, 0); 482 + trace_power_start(POWER_CSTATE, 0, smp_processor_id()); 483 483 local_irq_enable(); 484 484 while (!need_resched()) 485 485 cpu_relax();
+9 -9
drivers/cpufreq/cpufreq.c
··· 29 29 #include <linux/completion.h> 30 30 #include <linux/mutex.h> 31 31 32 + #include <trace/events/power.h> 33 + 32 34 #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_CORE, \ 33 35 "cpufreq-core", msg) 34 36 ··· 70 68 static DEFINE_PER_CPU(struct rw_semaphore, cpu_policy_rwsem); 71 69 72 70 #define lock_policy_rwsem(mode, cpu) \ 73 - int lock_policy_rwsem_##mode \ 71 + static int lock_policy_rwsem_##mode \ 74 72 (int cpu) \ 75 73 { \ 76 74 int policy_cpu = per_cpu(cpufreq_policy_cpu, cpu); \ ··· 85 83 } 86 84 87 85 lock_policy_rwsem(read, cpu); 88 - EXPORT_SYMBOL_GPL(lock_policy_rwsem_read); 89 86 90 87 lock_policy_rwsem(write, cpu); 91 - EXPORT_SYMBOL_GPL(lock_policy_rwsem_write); 92 88 93 - void unlock_policy_rwsem_read(int cpu) 89 + static void unlock_policy_rwsem_read(int cpu) 94 90 { 95 91 int policy_cpu = per_cpu(cpufreq_policy_cpu, cpu); 96 92 BUG_ON(policy_cpu == -1); 97 93 up_read(&per_cpu(cpu_policy_rwsem, policy_cpu)); 98 94 } 99 - EXPORT_SYMBOL_GPL(unlock_policy_rwsem_read); 100 95 101 - void unlock_policy_rwsem_write(int cpu) 96 + static void unlock_policy_rwsem_write(int cpu) 102 97 { 103 98 int policy_cpu = per_cpu(cpufreq_policy_cpu, cpu); 104 99 BUG_ON(policy_cpu == -1); 105 100 up_write(&per_cpu(cpu_policy_rwsem, policy_cpu)); 106 101 } 107 - EXPORT_SYMBOL_GPL(unlock_policy_rwsem_write); 108 102 109 103 110 104 /* internal prototypes */ ··· 352 354 353 355 case CPUFREQ_POSTCHANGE: 354 356 adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); 357 + dprintk("FREQ: %lu - CPU: %lu", (unsigned long)freqs->new, 358 + (unsigned long)freqs->cpu); 359 + trace_power_frequency(POWER_PSTATE, freqs->new, freqs->cpu); 355 360 srcu_notifier_call_chain(&cpufreq_transition_notifier_list, 356 361 CPUFREQ_POSTCHANGE, freqs); 357 362 if (likely(policy) && likely(policy->cpu == freqs->cpu)) ··· 1876 1875 return NOTIFY_OK; 1877 1876 } 1878 1877 1879 - static struct notifier_block __refdata cpufreq_cpu_notifier = 1880 - { 1878 + static struct notifier_block __refdata cpufreq_cpu_notifier = { 1881 1879 .notifier_call = cpufreq_cpu_callback, 1882 1880 }; 1883 1881
+18 -15
drivers/cpufreq/cpufreq_ondemand.c
··· 459 459 460 460 /************************** sysfs end ************************/ 461 461 462 + static void dbs_freq_increase(struct cpufreq_policy *p, unsigned int freq) 463 + { 464 + if (dbs_tuners_ins.powersave_bias) 465 + freq = powersave_bias_target(p, freq, CPUFREQ_RELATION_H); 466 + else if (p->cur == p->max) 467 + return; 468 + 469 + __cpufreq_driver_target(p, freq, dbs_tuners_ins.powersave_bias ? 470 + CPUFREQ_RELATION_L : CPUFREQ_RELATION_H); 471 + } 472 + 462 473 static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) 463 474 { 464 475 unsigned int max_load_freq; ··· 562 551 563 552 /* Check for frequency increase */ 564 553 if (max_load_freq > dbs_tuners_ins.up_threshold * policy->cur) { 565 - /* if we are already at full speed then break out early */ 566 - if (!dbs_tuners_ins.powersave_bias) { 567 - if (policy->cur == policy->max) 568 - return; 569 - 570 - __cpufreq_driver_target(policy, policy->max, 571 - CPUFREQ_RELATION_H); 572 - } else { 573 - int freq = powersave_bias_target(policy, policy->max, 574 - CPUFREQ_RELATION_H); 575 - __cpufreq_driver_target(policy, freq, 576 - CPUFREQ_RELATION_L); 577 - } 554 + dbs_freq_increase(policy, policy->max); 578 555 return; 579 556 } 580 557 ··· 609 610 /* We want all CPUs to do sampling nearly on same jiffy */ 610 611 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); 611 612 612 - delay -= jiffies % delay; 613 + if (num_online_cpus() > 1) 614 + delay -= jiffies % delay; 615 + 613 616 mutex_lock(&dbs_info->timer_mutex); 614 617 615 618 /* Common NORMAL_SAMPLE setup */ ··· 636 635 { 637 636 /* We want all CPUs to do sampling nearly on same jiffy */ 638 637 int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); 639 - delay -= jiffies % delay; 638 + 639 + if (num_online_cpus() > 1) 640 + delay -= jiffies % delay; 640 641 641 642 dbs_info->sample_type = DBS_NORMAL_SAMPLE; 642 643 INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer);
+1 -1
drivers/cpuidle/cpuidle.c
··· 95 95 /* give the governor an opportunity to reflect on the outcome */ 96 96 if (cpuidle_curr_governor->reflect) 97 97 cpuidle_curr_governor->reflect(dev); 98 - trace_power_end(0); 98 + trace_power_end(smp_processor_id()); 99 99 } 100 100 101 101 /**
+1 -1
drivers/idle/intel_idle.c
··· 231 231 232 232 stop_critical_timings(); 233 233 #ifndef MODULE 234 - trace_power_start(POWER_CSTATE, (eax >> 4) + 1); 234 + trace_power_start(POWER_CSTATE, (eax >> 4) + 1, cpu); 235 235 #endif 236 236 if (!need_resched()) { 237 237
-5
include/linux/cpufreq.h
··· 196 196 int cpufreq_register_governor(struct cpufreq_governor *governor); 197 197 void cpufreq_unregister_governor(struct cpufreq_governor *governor); 198 198 199 - int lock_policy_rwsem_read(int cpu); 200 - int lock_policy_rwsem_write(int cpu); 201 - void unlock_policy_rwsem_read(int cpu); 202 - void unlock_policy_rwsem_write(int cpu); 203 - 204 199 205 200 /********************************************************************* 206 201 * CPUFREQ DRIVER INTERFACE *
+15 -12
include/trace/events/power.h
··· 18 18 19 19 DECLARE_EVENT_CLASS(power, 20 20 21 - TP_PROTO(unsigned int type, unsigned int state), 21 + TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), 22 22 23 - TP_ARGS(type, state), 23 + TP_ARGS(type, state, cpu_id), 24 24 25 25 TP_STRUCT__entry( 26 26 __field( u64, type ) 27 27 __field( u64, state ) 28 + __field( u64, cpu_id ) 28 29 ), 29 30 30 31 TP_fast_assign( 31 32 __entry->type = type; 32 33 __entry->state = state; 34 + __entry->cpu_id = cpu_id; 33 35 ), 34 36 35 - TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) 37 + TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type, 38 + (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) 36 39 ); 37 40 38 41 DEFINE_EVENT(power, power_start, 39 42 40 - TP_PROTO(unsigned int type, unsigned int state), 43 + TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), 41 44 42 - TP_ARGS(type, state) 45 + TP_ARGS(type, state, cpu_id) 43 46 ); 44 47 45 48 DEFINE_EVENT(power, power_frequency, 46 49 47 - TP_PROTO(unsigned int type, unsigned int state), 50 + TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), 48 51 49 - TP_ARGS(type, state) 52 + TP_ARGS(type, state, cpu_id) 50 53 ); 51 54 52 55 TRACE_EVENT(power_end, 53 56 54 - TP_PROTO(int dummy), 57 + TP_PROTO(unsigned int cpu_id), 55 58 56 - TP_ARGS(dummy), 59 + TP_ARGS(cpu_id), 57 60 58 61 TP_STRUCT__entry( 59 - __field( u64, dummy ) 62 + __field( u64, cpu_id ) 60 63 ), 61 64 62 65 TP_fast_assign( 63 - __entry->dummy = 0xffff; 66 + __entry->cpu_id = cpu_id; 64 67 ), 65 68 66 - TP_printk("dummy=%lu", (unsigned long)__entry->dummy) 69 + TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id) 67 70 68 71 ); 69 72
+6 -5
tools/perf/builtin-timechart.c
··· 300 300 301 301 struct power_entry { 302 302 struct trace_entry te; 303 - s64 type; 304 - s64 value; 303 + u64 type; 304 + u64 value; 305 + u64 cpu_id; 305 306 }; 306 307 307 308 #define TASK_COMM_LEN 16 ··· 499 498 return 0; 500 499 501 500 if (strcmp(event_str, "power:power_start") == 0) 502 - c_state_start(data.cpu, data.time, pe->value); 501 + c_state_start(pe->cpu_id, data.time, pe->value); 503 502 504 503 if (strcmp(event_str, "power:power_end") == 0) 505 - c_state_end(data.cpu, data.time); 504 + c_state_end(pe->cpu_id, data.time); 506 505 507 506 if (strcmp(event_str, "power:power_frequency") == 0) 508 - p_state_change(data.cpu, data.time, pe->value); 507 + p_state_change(pe->cpu_id, data.time, pe->value); 509 508 510 509 if (strcmp(event_str, "sched:sched_wakeup") == 0) 511 510 sched_wakeup(data.cpu, data.time, data.pid, te);