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

s390/cpum_sf: Replace function name in debug statements

Replace hard coded function names in debug statements
by the "%s ...", __func__ construct suggested by checkpatch.pl
script. Use consistent debug print format of the form variable
blank value. Also add leading 0x for all hex values.
Print allocated page addresses consistantly as hex numbers
with leading 0x.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Thomas Richter and committed by
Vasily Gorbik
532da3de a9f2f686

+57 -52
+1 -1
arch/s390/include/asm/cpu_mf.h
··· 313 313 return (unsigned long *) ret; 314 314 } 315 315 316 - /* Return if the entry in the sample data block table (sdbt) 316 + /* Return true if the entry in the sample data block table (sdbt) 317 317 * is a link to the next sdbt */ 318 318 static inline int is_link_entry(unsigned long *s) 319 319 {
+56 -51
arch/s390/kernel/perf_cpum_sf.c
··· 156 156 } 157 157 } 158 158 159 - debug_sprintf_event(sfdbg, 5, "%s freed sdbt %p\n", __func__, 160 - sfb->sdbt); 159 + debug_sprintf_event(sfdbg, 5, "%s: freed sdbt %#lx\n", __func__, 160 + (unsigned long)sfb->sdbt); 161 161 memset(sfb, 0, sizeof(*sfb)); 162 162 } 163 163 ··· 213 213 */ 214 214 if (sfb->sdbt != get_next_sdbt(tail)) { 215 215 debug_sprintf_event(sfdbg, 3, "%s: " 216 - "sampling buffer is not linked: origin %p" 217 - " tail %p\n", __func__, 218 - (void *)sfb->sdbt, (void *)tail); 216 + "sampling buffer is not linked: origin %#lx" 217 + " tail %#lx\n", __func__, 218 + (unsigned long)sfb->sdbt, 219 + (unsigned long)tail); 219 220 return -EINVAL; 220 221 } 221 222 ··· 252 251 *tail = (unsigned long) sfb->sdbt + 1; 253 252 sfb->tail = tail; 254 253 255 - debug_sprintf_event(sfdbg, 4, "realloc_sampling_buffer: new buffer" 256 - " settings: sdbt %lu sdb %lu\n", 254 + debug_sprintf_event(sfdbg, 4, "%s: new buffer" 255 + " settings: sdbt %lu sdb %lu\n", __func__, 257 256 sfb->num_sdbt, sfb->num_sdb); 258 257 return rc; 259 258 } ··· 293 292 rc = realloc_sampling_buffer(sfb, num_sdb, GFP_KERNEL); 294 293 if (rc) { 295 294 free_sampling_buffer(sfb); 296 - debug_sprintf_event(sfdbg, 4, "alloc_sampling_buffer: " 297 - "realloc_sampling_buffer failed with rc %i\n", rc); 295 + debug_sprintf_event(sfdbg, 4, "%s: " 296 + "realloc_sampling_buffer failed with rc %i\n", 297 + __func__, rc); 298 298 } else 299 299 debug_sprintf_event(sfdbg, 4, 300 - "alloc_sampling_buffer: tear %p dear %p\n", 301 - sfb->sdbt, (void *)*sfb->sdbt); 300 + "%s: tear %#lx dear %#lx\n", __func__, 301 + (unsigned long)sfb->sdbt, (unsigned long)*sfb->sdbt); 302 302 return rc; 303 303 } 304 304 ··· 467 465 if (num) 468 466 sfb_account_allocs(num, hwc); 469 467 470 - debug_sprintf_event(sfdbg, 5, "sfb: overflow: overflow %llu ratio %lu" 471 - " num %lu\n", OVERFLOW_REG(hwc), ratio, num); 468 + debug_sprintf_event(sfdbg, 5, "%s: overflow %llu ratio %lu num %lu\n", 469 + __func__, OVERFLOW_REG(hwc), ratio, num); 472 470 OVERFLOW_REG(hwc) = 0; 473 471 } 474 472 ··· 506 504 */ 507 505 rc = realloc_sampling_buffer(sfb, num, GFP_ATOMIC); 508 506 if (rc) 509 - debug_sprintf_event(sfdbg, 5, "sfb: extend: realloc " 510 - "failed with rc %i\n", rc); 507 + debug_sprintf_event(sfdbg, 5, "%s: realloc failed with rc %i\n", 508 + __func__, rc); 511 509 512 510 if (sfb_has_pending_allocs(sfb, hwc)) 513 - debug_sprintf_event(sfdbg, 5, "sfb: extend: " 511 + debug_sprintf_event(sfdbg, 5, "%s: " 514 512 "req %lu alloc %lu remaining %lu\n", 515 - num, sfb->num_sdb - num_old, 513 + __func__, num, sfb->num_sdb - num_old, 516 514 sfb_pending_allocs(sfb, hwc)); 517 515 } 518 516 ··· 700 698 */ 701 699 if (sample_rate_to_freq(si, rate) > 702 700 sysctl_perf_event_sample_rate) { 703 - debug_sprintf_event(sfdbg, 1, 701 + debug_sprintf_event(sfdbg, 1, "%s: " 704 702 "Sampling rate exceeds maximum " 705 - "perf sample rate\n"); 703 + "perf sample rate\n", __func__); 706 704 rate = 0; 707 705 } 708 706 } ··· 747 745 attr->sample_period = rate; 748 746 SAMPL_RATE(hwc) = rate; 749 747 hw_init_period(hwc, SAMPL_RATE(hwc)); 750 - debug_sprintf_event(sfdbg, 4, "__hw_perf_event_init_rate:" 751 - "cpu:%d period:%#llx freq:%d,%#lx\n", event->cpu, 752 - event->attr.sample_period, event->attr.freq, 753 - SAMPLE_FREQ_MODE(hwc)); 748 + debug_sprintf_event(sfdbg, 4, "%s: cpu %d period %#llx freq %d,%#lx\n", 749 + __func__, event->cpu, event->attr.sample_period, 750 + event->attr.freq, SAMPLE_FREQ_MODE(hwc)); 754 751 return 0; 755 752 } 756 753 ··· 974 973 /* Load current program parameter */ 975 974 lpp(&S390_lowcore.lpp); 976 975 977 - debug_sprintf_event(sfdbg, 6, "pmu_enable: es %i cs %i ed %i cd %i " 978 - "interval %#lx tear %p dear %p\n", 976 + debug_sprintf_event(sfdbg, 6, "%s: es %i cs %i ed %i cd %i " 977 + "interval %#lx tear %#lx dear %#lx\n", __func__, 979 978 cpuhw->lsctl.es, cpuhw->lsctl.cs, cpuhw->lsctl.ed, 980 979 cpuhw->lsctl.cd, cpuhw->lsctl.interval, 981 - (void *) cpuhw->lsctl.tear, 982 - (void *) cpuhw->lsctl.dear); 980 + cpuhw->lsctl.tear, cpuhw->lsctl.dear); 983 981 } 984 982 985 983 static void cpumsf_pmu_disable(struct pmu *pmu) ··· 1019 1019 cpuhw->lsctl.dear = si.dear; 1020 1020 } 1021 1021 } else 1022 - debug_sprintf_event(sfdbg, 3, "cpumsf_pmu_disable: " 1023 - "qsi() failed with err %i\n", err); 1022 + debug_sprintf_event(sfdbg, 3, "%s: qsi() failed with err %i\n", 1023 + __func__, err); 1024 1024 1025 1025 cpuhw->flags &= ~PMU_F_ENABLED; 1026 1026 } ··· 1265 1265 sampl_overflow += te->overflow; 1266 1266 1267 1267 /* Timestamps are valid for full sample-data-blocks only */ 1268 - debug_sprintf_event(sfdbg, 6, "%s: sdbt %p " 1268 + debug_sprintf_event(sfdbg, 6, "%s: sdbt %#lx " 1269 1269 "overflow %llu timestamp %#llx\n", 1270 - __func__, sdbt, te->overflow, 1270 + __func__, (unsigned long)sdbt, te->overflow, 1271 1271 (te->f) ? trailer_timestamp(te) : 0ULL); 1272 1272 1273 1273 /* Collect all samples from a single sample-data-block and ··· 1312 1312 sampl_overflow, 1 + num_sdb); 1313 1313 if (sampl_overflow || event_overflow) 1314 1314 debug_sprintf_event(sfdbg, 4, "%s: " 1315 - "overflow stats: sample %llu event %llu\n", 1316 - __func__, sampl_overflow, event_overflow); 1315 + "overflows: sample %llu event %llu" 1316 + " total %llu num_sdb %llu\n", 1317 + __func__, sampl_overflow, event_overflow, 1318 + OVERFLOW_REG(hwc), num_sdb); 1317 1319 } 1318 1320 1319 1321 #define AUX_SDB_INDEX(aux, i) ((i) % aux->sfb.num_sdb) ··· 1426 1424 cpuhw->lsctl.tear = base + offset * sizeof(unsigned long); 1427 1425 cpuhw->lsctl.dear = aux->sdb_index[head]; 1428 1426 1429 - debug_sprintf_event(sfdbg, 6, "aux_output_begin: " 1427 + debug_sprintf_event(sfdbg, 6, "%s: " 1430 1428 "head->alert_mark->empty_mark (num_alert, range)" 1431 1429 "[%#lx -> %#lx -> %#lx] (%#lx, %#lx) " 1432 - "tear index %#lx, tear %#lx dear %#lx\n", 1430 + "tear index %#lx, tear %#lx dear %#lx\n", __func__, 1433 1431 aux->head, aux->alert_mark, aux->empty_mark, 1434 1432 AUX_SDB_NUM_ALERT(aux), range, 1435 1433 head / CPUM_SF_SDB_PER_TABLE, ··· 1573 1571 pr_err("The AUX buffer with %lu pages for the " 1574 1572 "diagnostic-sampling mode is full\n", 1575 1573 num_sdb); 1576 - debug_sprintf_event(sfdbg, 1, "AUX buffer used up\n"); 1574 + debug_sprintf_event(sfdbg, 1, 1575 + "%s: AUX buffer used up\n", 1576 + __func__); 1577 1577 break; 1578 1578 } 1579 1579 if (WARN_ON_ONCE(!aux)) ··· 1598 1594 perf_aux_output_end(&cpuhw->handle, size); 1599 1595 pr_err("Sample data caused the AUX buffer with %lu " 1600 1596 "pages to overflow\n", num_sdb); 1601 - debug_sprintf_event(sfdbg, 1, "head %#lx range %#lx " 1602 - "overflow %#llx\n", 1597 + debug_sprintf_event(sfdbg, 1, "%s: head %#lx range %#lx " 1598 + "overflow %#llx\n", __func__, 1603 1599 aux->head, range, overflow); 1604 1600 } else { 1605 1601 size = AUX_SDB_NUM_ALERT(aux) << PAGE_SHIFT; 1606 1602 perf_aux_output_end(&cpuhw->handle, size); 1607 - debug_sprintf_event(sfdbg, 6, "head %#lx alert %#lx " 1603 + debug_sprintf_event(sfdbg, 6, "%s: head %#lx alert %#lx " 1608 1604 "already full, try another\n", 1605 + __func__, 1609 1606 aux->head, aux->alert_mark); 1610 1607 } 1611 1608 } 1612 1609 1613 1610 if (done) 1614 - debug_sprintf_event(sfdbg, 6, "aux_reset_buffer: " 1611 + debug_sprintf_event(sfdbg, 6, "%s: aux_reset_buffer " 1615 1612 "[%#lx -> %#lx -> %#lx] (%#lx, %#lx)\n", 1616 - aux->head, aux->alert_mark, aux->empty_mark, 1617 - AUX_SDB_NUM_ALERT(aux), range); 1613 + __func__, aux->head, aux->alert_mark, 1614 + aux->empty_mark, AUX_SDB_NUM_ALERT(aux), 1615 + range); 1618 1616 } 1619 1617 1620 1618 /* ··· 1639 1633 kfree(aux->sdb_index); 1640 1634 kfree(aux); 1641 1635 1642 - debug_sprintf_event(sfdbg, 4, "aux_buffer_free: free " 1643 - "%lu SDBTs\n", num_sdbt); 1636 + debug_sprintf_event(sfdbg, 4, "%s: free " 1637 + "%lu SDBTs\n", __func__, num_sdbt); 1644 1638 } 1645 1639 1646 1640 static void aux_sdb_init(unsigned long sdb) ··· 1748 1742 */ 1749 1743 aux->empty_mark = sfb->num_sdb - 1; 1750 1744 1751 - debug_sprintf_event(sfdbg, 4, "aux_buffer_setup: setup %lu SDBTs" 1752 - " and %lu SDBs\n", 1753 - sfb->num_sdbt, sfb->num_sdb); 1745 + debug_sprintf_event(sfdbg, 4, "%s: setup %lu SDBTs and %lu SDBs\n", 1746 + __func__, sfb->num_sdbt, sfb->num_sdb); 1754 1747 1755 1748 return aux; 1756 1749 ··· 1802 1797 event->attr.sample_period = rate; 1803 1798 SAMPL_RATE(&event->hw) = rate; 1804 1799 hw_init_period(&event->hw, SAMPL_RATE(&event->hw)); 1805 - debug_sprintf_event(sfdbg, 4, "cpumsf_pmu_check_period:" 1806 - "cpu:%d value:%#llx period:%#llx freq:%d\n", 1807 - event->cpu, value, 1800 + debug_sprintf_event(sfdbg, 4, "%s:" 1801 + " cpu %d value %#llx period %#llx freq %d\n", 1802 + __func__, event->cpu, value, 1808 1803 event->attr.sample_period, do_freq); 1809 1804 return 0; 1810 1805 } ··· 2035 2030 2036 2031 /* Report measurement alerts only for non-PRA codes */ 2037 2032 if (alert != CPU_MF_INT_SF_PRA) 2038 - debug_sprintf_event(sfdbg, 6, "measurement alert: %#x\n", 2033 + debug_sprintf_event(sfdbg, 6, "%s: alert %#x\n", __func__, 2039 2034 alert); 2040 2035 2041 2036 /* Sampling authorization change request */