Changes in 5.10.180 seccomp: Move copy_seccomp() to no failure path. counter: 104-quad-8: Fix race condition between FLAG and CNTR reads KVM: arm64: Fix buffer overflow in kvm_arm_set_fw_reg() wifi: brcmfmac: slab-out-of-bounds read in brcmf_get_assoc_ies() drm/fb-helper: set x/yres_virtual in drm_fb_helper_check_var bluetooth: Perform careful capability checks in hci_sock_ioctl() x86/fpu: Prevent FPU state corruption USB: serial: option: add UNISOC vendor and TOZED LT70C product driver core: Don't require dynamic_debug for initcall_debug probe timing iio: adc: palmas_gpadc: fix NULL dereference on rmmod ASoC: Intel: bytcr_rt5640: Add quirk for the Acer Iconia One 7 B1-750 asm-generic/io.h: suppress endianness warnings for readq() and writeq() wireguard: timers: cast enum limits members to int in prints PCI: pciehp: Fix AB-BA deadlock between reset_lock and device_lock PCI: qcom: Fix the incorrect register usage in v2.7.0 config USB: dwc3: fix runtime pm imbalance on probe errors USB: dwc3: fix runtime pm imbalance on unbind hwmon: (k10temp) Check range scale when CUR_TEMP register is read-write hwmon: (adt7475) Use device_property APIs when configuring polarity posix-cpu-timers: Implement the missing timer_wait_running callback perf sched: Cast PTHREAD_STACK_MIN to int as it may turn into sysconf(__SC_THREAD_STACK_MIN_VALUE) blk-mq: release crypto keyslot before reporting I/O complete blk-crypto: make blk_crypto_evict_key() return void blk-crypto: make blk_crypto_evict_key() more robust ext4: use ext4_journal_start/stop for fast commit transactions staging: iio: resolver: ads1210: fix config mode xhci: fix debugfs register accesses while suspended tick/nohz: Fix cpu_is_hotpluggable() by checking with nohz subsystem MIPS: fw: Allow firmware to pass a empty env ipmi:ssif: Add send_retries increment ipmi: fix SSIF not responding under certain cond. kheaders: Use array declaration instead of char pwm: meson: Fix axg ao mux parents pwm: meson: Fix g12a ao clk81 name ring-buffer: Sync IRQ works before buffer destruction crypto: api - Demote BUG_ON() in crypto_unregister_alg() to a WARN_ON() crypto: safexcel - Cleanup ring IRQ workqueues on load failure rcu: Avoid stack overflow due to __rcu_irq_enter_check_tick() being kprobe-ed reiserfs: Add security prefix to xattr name in reiserfs_security_write() KVM: nVMX: Emulate NOPs in L2, and PAUSE if it's not intercepted relayfs: fix out-of-bounds access in relay_file_read writeback, cgroup: fix null-ptr-deref write in bdi_split_work_to_wbs i2c: omap: Fix standard mode false ACK readings iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE Revert "ubifs: dirty_cow_znode: Fix memleak in error handling path" ubifs: Fix memleak when insert_old_idx() failed ubi: Fix return value overwrite issue in try_write_vid_and_data() ubifs: Free memory for tmpfile name sound/oss/dmasound: fix build when drivers are mixed =y/=m parisc: Fix argument pointer in real64_call_asm() nilfs2: do not write dirty data after degenerating to read-only nilfs2: fix infinite loop in nilfs_mdt_get_block() md/raid10: fix null-ptr-deref in raid10_sync_request mailbox: zynqmp: Fix IPI isr handling mailbox: zynqmp: Fix typo in IPI documentation wifi: rtl8xxxu: RTL8192EU always needs full init clk: rockchip: rk3399: allow clk_cifout to force clk_cifout_src to reparent rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem selftests/resctrl: Check for return value after write_schemata() selinux: fix Makefile dependencies of flask.h selinux: ensure av_permissions.h is built when needed tpm, tpm_tis: Do not skip reset of original interrupt vector tpm, tpm_tis: Claim locality before writing TPM_INT_ENABLE register tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed tpm, tpm_tis: Claim locality before writing interrupt registers tpm, tpm: Implement usage counter for locality tpm, tpm_tis: Claim locality when interrupts are reenabled on resume erofs: stop parsing non-compact HEAD index if clusterofs is invalid erofs: fix potential overflow calculating xattr_isize drm/rockchip: Drop unbalanced obj unref drm/vgem: add missing mutex_destroy drm/probe-helper: Cancel previous job before starting new one soc: ti: pm33xx: Enable basic PM runtime support for genpd soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe arm64: dts: renesas: r8a77990: Remove bogus voltages from OPP table arm64: dts: renesas: r8a774c0: Remove bogus voltages from OPP table drm/msm/disp/dpu: check for crtc enable rather than crtc active to release shared resources EDAC/skx: Fix overflows on the DRAM row address mapping arrays arm64: dts: qcom: msm8998: Fix stm-stimulus-base reg name arm64: dts: qcom: sdm845: correct dynamic power coefficients arm64: dts: qcom: sdm845: Fix the PCI I/O port range arm64: dts: qcom: msm8998: Fix the PCI I/O port range arm64: dts: qcom: ipq8074: Fix the PCI I/O port range arm64: dts: qcom: msm8996: Fix the PCI I/O port range ARM: dts: qcom: ipq4019: Fix the PCI I/O port range ARM: dts: qcom: ipq8064: reduce pci IO size to 64K ARM: dts: qcom: ipq8064: Fix the PCI I/O port range x86/MCE/AMD: Use an u64 for bank_map media: bdisp: Add missing check for create_workqueue firmware: qcom_scm: Clear download bit during reboot drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535 media: max9286: Free control handler drm/msm/adreno: Defer enabling runpm until hw_init() drm/msm/adreno: drop bogus pm_runtime_set_active() drm: msm: adreno: Disable preemption on Adreno 510 ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data ARM: dts: gta04: fix excess dma channel usage drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe() regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow() regulator: core: Avoid lockdep reports when resolving supplies x86/apic: Fix atomic update of offset in reserve_eilvt_offset() media: rkvdec: fix use after free bug in rkvdec_remove media: dm1105: Fix use after free bug in dm1105_remove due to race condition media: saa7134: fix use after free bug in saa7134_finidev due to race condition media: rcar_fdp1: simplify error check logic at fdp_open() media: rcar_fdp1: fix pm_runtime_get_sync() usage count media: rcar_fdp1: Make use of the helper function devm_platform_ioremap_resource() media: rcar_fdp1: Fix the correct variable assignments media: rcar_fdp1: Fix refcount leak in probe and remove function media: rc: gpio-ir-recv: Fix support for wake-up media: venus: vdec: Fix non reliable setting of LAST flag media: venus: vdec: Make decoder return LAST flag for sufficient event media: venus: preserve DRC state across seeks media: venus: vdec: Handle DRC after drain media: venus: dec: Fix handling of the start cmd regulator: stm32-pwr: fix of_iomap leak x86/ioapic: Don't return 0 from arch_dynirq_lower_bound() arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step debugobject: Prevent init race with static objects drm/i915: Make intel_get_crtc_new_encoder() less oopsy tick/sched: Use tick_next_period for lockless quick check tick/sched: Reduce seqcount held scope in tick_do_update_jiffies64() tick/sched: Optimize tick_do_update_jiffies64() further tick: Get rid of tick_period tick/common: Align tick period with the HZ tick. wifi: ath6kl: minor fix for allocation size wifi: ath9k: hif_usb: fix memory leak of remain_skbs wifi: ath5k: fix an off by one check in ath5k_eeprom_read_freq_list() wifi: ath6kl: reduce WARN to dev_dbg() in callback tools: bpftool: Remove invalid \' json escape wifi: rtw88: mac: Return the original error from rtw_pwr_seq_parser() wifi: rtw88: mac: Return the original error from rtw_mac_power_switch() bpf: take into account liveness when propagating precision bpf: fix precision propagation verbose logging scm: fix MSG_CTRUNC setting condition for SO_PASSSEC bpf: Remove misleading spec_v1 check on var-offset stack read vlan: partially enable SIOCSHWTSTAMP in container net/packet: annotate accesses to po->xmit net/packet: convert po->origdev to an atomic flag net/packet: convert po->auxdata to an atomic flag scsi: target: Rename struct sense_info to sense_detail scsi: target: Rename cmd.bad_sector to cmd.sense_info scsi: target: Make state_list per CPU scsi: target: Fix multiple LUN_RESET handling scsi: target: iscsit: Fix TAS handling during conn cleanup scsi: megaraid: Fix mega_cmd_done() CMDID_INT_CMDS f2fs: handle dqget error in f2fs_transfer_project_quota() f2fs: enforce single zone capacity f2fs: apply zone capacity to all zone type f2fs: compress: fix to call f2fs_wait_on_page_writeback() in f2fs_write_raw_pages() crypto: caam - Clear some memory in instantiate_rng crypto: sa2ul - Select CRYPTO_DES wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_rfreg() wifi: rtlwifi: fix incorrect error codes in rtl_debugfs_set_write_reg() net: qrtr: correct types of trace event parameters selftests/bpf: Wait for receive in cg_storage_multi test bpftool: Fix bug for long instructions in program CFG dumps crypto: drbg - make drbg_prepare_hrng() handle jent instantiation errors crypto: drbg - Only fail when jent is unavailable in FIPS mode xsk: Fix unaligned descriptor validation f2fs: fix to avoid use-after-free for cached IPU bio scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup() net: ethernet: stmmac: dwmac-rk: fix optional phy regulator handling bpf, sockmap: fix deadlocks in the sockhash and sockmap nvme: handle the persistent internal error AER nvme: fix async event trace event nvme-fcloop: fix "inconsistent {IN-HARDIRQ-W} -> {HARDIRQ-ON-W} usage" bpf, sockmap: Revert buggy deadlock fix in the sockhash and sockmap md/raid10: fix leak of 'r10bio->remaining' for recovery md/raid10: fix memleak for 'conf->bio_split' md/raid10: fix memleak of md thread wifi: iwlwifi: yoyo: Fix possible division by zero wifi: iwlwifi: fw: move memset before early return jdb2: Don't refuse invalidation of already invalidated buffers wifi: iwlwifi: make the loop for card preparation effective wifi: iwlwifi: mvm: check firmware response size wifi: iwlwifi: fw: fix memory leak in debugfs ixgbe: Allow flow hash to be set via ethtool ixgbe: Enable setting RSS table to default values bpf: Don't EFAULT for getsockopt with optval=NULL netfilter: nf_tables: don't write table validation state without mutex net/sched: sch_fq: fix integer overflow of "credit" ipv4: Fix potential uninit variable access bug in __ip_make_skb() Revert "Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work" netlink: Use copy_to_user() for optval in netlink_getsockopt(). net: amd: Fix link leak when verifying config failed tcp/udp: Fix memleaks of sk and zerocopy skbs with TX timestamp. ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it pstore: Revert pmsg_lock back to a normal mutex usb: host: xhci-rcar: remove leftover quirk handling usb: dwc3: gadget: Change condition for processing suspend event fpga: bridge: fix kernel-doc parameter description iio: light: max44009: add missing OF device matching spi: spi-imx: using pm_runtime_resume_and_get instead of pm_runtime_get_sync spi: imx: Don't skip cleanup in remove's error path usb: gadget: udc: renesas_usb3: Fix use after free bug in renesas_usb3_remove due to race condition PCI: imx6: Install the fault handler only on compatible match ASoC: es8316: Use IRQF_NO_AUTOEN when requesting the IRQ ASoC: es8316: Handle optional IRQ assignment linux/vt_buffer.h: allow either builtin or modular for macros spi: qup: Don't skip cleanup in remove's error path spi: fsl-spi: Fix CPM/QE mode Litte Endian vmci_host: fix a race condition in vmci_host_poll() causing GPF of: Fix modalias string generation PCI/EDR: Clear Device Status after EDR error recovery ia64: mm/contig: fix section mismatch warning/error ia64: salinfo: placate defined-but-not-used warning scripts/gdb: bail early if there are no clocks scripts/gdb: bail early if there are no generic PD coresight: etm_pmu: Set the module field ASoC: fsl_mqs: move of_node_put() to the correct location spi: cadence-quadspi: fix suspend-resume implementations i2c: cadence: cdns_i2c_master_xfer(): Fix runtime PM leak on error path uapi/linux/const.h: prefer ISO-friendly __typeof__ sh: sq: Fix incorrect element size for allocating bitmap buffer usb: gadget: tegra-xudc: Fix crash in vbus_draw usb: chipidea: fix missing goto in `ci_hdrc_probe` usb: mtu3: fix kernel panic at qmu transfer done irq handler firmware: stratix10-svc: Fix an NULL vs IS_ERR() bug in probe tty: serial: fsl_lpuart: adjust buffer length to the intended size serial: 8250: Add missing wakeup event reporting staging: rtl8192e: Fix W_DISABLE# does not work after stop/start spmi: Add a check for remove callback when removing a SPMI driver macintosh/windfarm_smu_sat: Add missing of_node_put() powerpc/mpc512x: fix resource printk format warning powerpc/wii: fix resource printk format warnings powerpc/sysdev/tsi108: fix resource printk format warnings macintosh: via-pmu-led: requires ATA to be set powerpc/rtas: use memmove for potentially overlapping buffer copy perf/core: Fix hardlockup failure caused by perf throttle clk: at91: clk-sam9x60-pll: fix return value check RDMA/siw: Fix potential page_array out of range access RDMA/rdmavt: Delete unnecessary NULL check workqueue: Rename "delayed" (delayed by active management) to "inactive" workqueue: Fix hung time report of worker pools rtc: omap: include header for omap_rtc_power_off_program prototype RDMA/mlx4: Prevent shift wrapping in set_user_sq_size() rtc: meson-vrtc: Use ktime_get_real_ts64() to get the current time power: supply: generic-adc-battery: fix unit scaling clk: add missing of_node_put() in "assigned-clocks" property parsing RDMA/siw: Remove namespace check from siw_netdev_event() RDMA/cm: Trace icm_send_rej event before the cm state is reset RDMA/srpt: Add a check for valid 'mad_agent' pointer IB/hfi1: Fix SDMA mmu_rb_node not being evicted in LRU order IB/hfi1: Add AIP tx traces IB/hfi1: Add additional usdma traces IB/hfi1: Fix bugs with non-PAGE_SIZE-end multi-iovec user SDMA requests NFSv4.1: Always send a RECLAIM_COMPLETE after establishing lease firmware: raspberrypi: Introduce devm_rpi_firmware_get() input: raspberrypi-ts: Release firmware handle when not needed Input: raspberrypi-ts - fix refcount leak in rpi_ts_probe RDMA/mlx5: Fix flow counter query via DEVX SUNRPC: remove the maximum number of retries in call_bind_status RDMA/mlx5: Use correct device num_ports when modify DC clocksource/drivers/davinci: Fix memory leak in davinci_timer_register when init fails openrisc: Properly store r31 to pt_regs on unhandled exceptions ext4: fix use-after-free read in ext4_find_extent for bigalloc + inline leds: TI_LMU_COMMON: select REGMAP instead of depending on it dmaengine: mv_xor_v2: Fix an error code. leds: tca6507: Fix error handling of using fwnode_property_read_string pwm: mtk-disp: Don't check the return code of pwmchip_remove() pwm: mtk-disp: Adjust the clocks to avoid them mismatch pwm: mtk-disp: Disable shadow registers before setting backlight values phy: tegra: xusb: Add missing tegra_xusb_port_unregister for usb2_port and ulpi_port dmaengine: dw-edma: Fix to change for continuous transfer dmaengine: dw-edma: Fix to enable to issue dma request on DMA processing dmaengine: at_xdmac: do not enable all cyclic channels thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe mfd: tqmx86: Do not access I2C_DETECT register through io_base mfd: tqmx86: Remove incorrect TQMx90UC board ID mfd: tqmx86: Add support for TQMx110EB and TQMxE40x mfd: tqmx86: Specify IO port register range more precisely mfd: tqmx86: Correct board names for TQMxE39x afs: Fix updating of i_size with dv jump from server scripts/gdb: fix lx-timerlist for Python3 btrfs: scrub: reject unsupported scrub flags s390/dasd: fix hanging blockdevice after request requeue ia64: fix an addr to taddr in huge_pte_offset() dm clone: call kmem_cache_destroy() in dm_clone_init() error path dm integrity: call kmem_cache_destroy() in dm_integrity_init() error path dm flakey: fix a crash with invalid table line dm ioctl: fix nested locking in table_clear() to remove deadlock concern perf auxtrace: Fix address filter entire kernel size perf intel-pt: Fix CYC timestamps after standalone CBR arm64: Always load shadow stack pointer directly from the task struct arm64: Stash shadow stack pointer in the task struct on interrupt debugobject: Ensure pool refill (again) sound/oss/dmasound: fix 'dmasound_setup' defined but not used arm64: dts: qcom: sdm845: correct dynamic power coefficients scsi: target: core: Avoid smp_processor_id() in preemptible code netfilter: nf_tables: deactivate anonymous set from preparation phase tty: create internal tty.h file tty: audit: move some local functions out of tty.h tty: move some internal tty lock enums and functions out of tty.h tty: move some tty-only functions to drivers/tty/tty.h tty: clean include/linux/tty.h up tty: Prevent writing chars during tcsetattr TCSADRAIN/FLUSH ring-buffer: Ensure proper resetting of atomic variables in ring_buffer_reset_online_cpus crypto: ccp - Clear PSP interrupt status register before calling handler mailbox: zynq: Switch to flexible array to simplify code mailbox: zynqmp: Fix counts of child nodes dm verity: skip redundant verity_handle_err() on I/O errors dm verity: fix error handling for check_at_most_once on FEC scsi: qedi: Fix use after free bug in qedi_remove() net/ncsi: clear Tx enable mode when handling a Config required AEN net/sched: cls_api: remove block_cb from driver_list before freeing sit: update dev->needed_headroom in ipip6_tunnel_bind_dev() net: dsa: mv88e6xxx: add mv88e6321 rsvd2cpu writeback: fix call of incorrect macro watchdog: dw_wdt: Fix the error handling path of dw_wdt_drv_probe() net/sched: act_mirred: Add carrier check sfc: Fix module EEPROM reporting for QSFP modules rxrpc: Fix hard call timeout units octeontx2-pf: Disable packet I/O for graceful exit octeontx2-vf: Detach LF resources on probe cleanup ionic: remove noise from ethtool rxnfc error msg af_packet: Don't send zero-byte data in packet_sendmsg_spkt(). drm/amdgpu: add a missing lock for AMDGPU_SCHED ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init` net: dsa: mt7530: fix corrupt frames using trgmii on 40 MHz XTAL MT7621 virtio_net: split free_unused_bufs() virtio_net: suppress cpu stall when free_unused_bufs net: enetc: check the index of the SFI rather than the handle perf vendor events power9: Remove UTF-8 characters from JSON files perf pmu: zfree() expects a pointer to a pointer to zero it after freeing its contents perf map: Delete two variable initialisations before null pointer checks in sort__sym_from_cmp() crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs() perf symbols: Fix return incorrect build_id size in elf_read_build_id() btrfs: fix btrfs_prev_leaf() to not return the same key twice btrfs: don't free qgroup space unless specified btrfs: print-tree: parent bytenr must be aligned to sector size cifs: fix pcchunk length type in smb2_copychunk_range platform/x86: touchscreen_dmi: Add upside-down quirk for GDIX1002 ts on the Juno Tablet platform/x86: touchscreen_dmi: Add info for the Dexp Ursus KX210i inotify: Avoid reporting event with invalid wd sh: math-emu: fix macro redefined warning sh: mcount.S: fix build error when PRINTK is not enabled sh: init: use OF_EARLY_FLATTREE for early init sh: nmi_debug: fix return value of __setup handler remoteproc: stm32: Call of_node_put() on iteration error remoteproc: st: Call of_node_put() on iteration error ARM: dts: exynos: fix WM8960 clock name in Itop Elite ARM: dts: s5pv210: correct MIPI CSIS clock name f2fs: fix potential corruption when moving a directory drm/panel: otm8009a: Set backlight parent to panel device drm/amdgpu: fix an amdgpu_irq_put() issue in gmc_v9_0_hw_fini() drm/amdgpu/gfx: disable gfx9 cp_ecc_error_irq only when enabling legacy gfx ras drm/amdgpu: disable sdma ecc irq only when sdma RAS is enabled in suspend HID: wacom: Set a default resolution for older tablets HID: wacom: insert timestamp to packed Bluetooth (BT) events KVM: x86: hyper-v: Avoid calling kvm_make_vcpus_request_mask() with vcpu_mask==NULL KVM: x86: do not report a vCPU as preempted outside instruction boundaries ext4: fix WARNING in mb_find_extent ext4: avoid a potential slab-out-of-bounds in ext4_group_desc_csum ext4: fix data races when using cached status extents ext4: check iomap type only if ext4_iomap_begin() does not fail ext4: improve error recovery code paths in __ext4_remount() ext4: fix deadlock when converting an inline directory in nojournal mode ext4: add bounds checking in get_max_inline_xattr_value_size() ext4: bail out of ext4_xattr_ibody_get() fails for any reason ext4: remove a BUG_ON in ext4_mb_release_group_pa() ext4: fix invalid free tracking in ext4_xattr_move_to_block() serial: 8250: Fix serial8250_tx_empty() race with DMA Tx drbd: correctly submit flush bio on barrier KVM: x86: Ensure PV TLB flush tracepoint reflects KVM behavior KVM: x86: Fix recording of guest steal time / preempted status KVM: Fix steal time asm constraints KVM: x86: Remove obsolete disabling of page faults in kvm_arch_vcpu_put() KVM: x86: do not set st->preempted when going back to user space KVM: x86: revalidate steal time cache if MSR value changes KVM: x86: do not report preemption if the steal time cache is stale KVM: x86: move guest_pv_has out of user_access section printk: declare printk_deferred_{enter,safe}() in include/linux/printk.h drm/exynos: move to use request_irq by IRQF_NO_AUTOEN flag mm/page_alloc: fix potential deadlock on zonelist_update_seq seqlock drm/amd/display: Fix hang when skipping modeset Linux 5.10.180 Change-Id: Ie0c8ae79d56d844ec23ec277d91d4c70c3e1e9a8 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
650 lines
18 KiB
C
650 lines
18 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __KERNEL_PRINTK__
|
|
#define __KERNEL_PRINTK__
|
|
|
|
#include <stdarg.h>
|
|
#include <linux/init.h>
|
|
#include <linux/kern_levels.h>
|
|
#include <linux/linkage.h>
|
|
#include <linux/ratelimit_types.h>
|
|
|
|
extern const char linux_banner[];
|
|
extern const char linux_proc_banner[];
|
|
|
|
extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */
|
|
|
|
#define PRINTK_MAX_SINGLE_HEADER_LEN 2
|
|
|
|
static inline int printk_get_level(const char *buffer)
|
|
{
|
|
if (buffer[0] == KERN_SOH_ASCII && buffer[1]) {
|
|
switch (buffer[1]) {
|
|
case '0' ... '7':
|
|
case 'c': /* KERN_CONT */
|
|
return buffer[1];
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
static inline const char *printk_skip_level(const char *buffer)
|
|
{
|
|
if (printk_get_level(buffer))
|
|
return buffer + 2;
|
|
|
|
return buffer;
|
|
}
|
|
|
|
static inline const char *printk_skip_headers(const char *buffer)
|
|
{
|
|
while (printk_get_level(buffer))
|
|
buffer = printk_skip_level(buffer);
|
|
|
|
return buffer;
|
|
}
|
|
|
|
#define CONSOLE_EXT_LOG_MAX 8192
|
|
|
|
/* printk's without a loglevel use this.. */
|
|
#define MESSAGE_LOGLEVEL_DEFAULT CONFIG_MESSAGE_LOGLEVEL_DEFAULT
|
|
|
|
/* We show everything that is MORE important than this.. */
|
|
#define CONSOLE_LOGLEVEL_SILENT 0 /* Mum's the word */
|
|
#define CONSOLE_LOGLEVEL_MIN 1 /* Minimum loglevel we let people use */
|
|
#define CONSOLE_LOGLEVEL_DEBUG 10 /* issue debug messages */
|
|
#define CONSOLE_LOGLEVEL_MOTORMOUTH 15 /* You can't shut this one up */
|
|
|
|
/*
|
|
* Default used to be hard-coded at 7, quiet used to be hardcoded at 4,
|
|
* we're now allowing both to be set from kernel config.
|
|
*/
|
|
#define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT
|
|
#define CONSOLE_LOGLEVEL_QUIET CONFIG_CONSOLE_LOGLEVEL_QUIET
|
|
|
|
extern int console_printk[];
|
|
|
|
#define console_loglevel (console_printk[0])
|
|
#define default_message_loglevel (console_printk[1])
|
|
#define minimum_console_loglevel (console_printk[2])
|
|
#define default_console_loglevel (console_printk[3])
|
|
|
|
static inline void console_silent(void)
|
|
{
|
|
console_loglevel = CONSOLE_LOGLEVEL_SILENT;
|
|
}
|
|
|
|
static inline void console_verbose(void)
|
|
{
|
|
if (console_loglevel)
|
|
console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH;
|
|
}
|
|
|
|
/* strlen("ratelimit") + 1 */
|
|
#define DEVKMSG_STR_MAX_SIZE 10
|
|
extern char devkmsg_log_str[];
|
|
struct ctl_table;
|
|
|
|
extern int suppress_printk;
|
|
|
|
struct va_format {
|
|
const char *fmt;
|
|
va_list *va;
|
|
};
|
|
|
|
/*
|
|
* FW_BUG
|
|
* Add this to a message where you are sure the firmware is buggy or behaves
|
|
* really stupid or out of spec. Be aware that the responsible BIOS developer
|
|
* should be able to fix this issue or at least get a concrete idea of the
|
|
* problem by reading your message without the need of looking at the kernel
|
|
* code.
|
|
*
|
|
* Use it for definite and high priority BIOS bugs.
|
|
*
|
|
* FW_WARN
|
|
* Use it for not that clear (e.g. could the kernel messed up things already?)
|
|
* and medium priority BIOS bugs.
|
|
*
|
|
* FW_INFO
|
|
* Use this one if you want to tell the user or vendor about something
|
|
* suspicious, but generally harmless related to the firmware.
|
|
*
|
|
* Use it for information or very low priority BIOS bugs.
|
|
*/
|
|
#define FW_BUG "[Firmware Bug]: "
|
|
#define FW_WARN "[Firmware Warn]: "
|
|
#define FW_INFO "[Firmware Info]: "
|
|
|
|
/*
|
|
* HW_ERR
|
|
* Add this to a message for hardware errors, so that user can report
|
|
* it to hardware vendor instead of LKML or software vendor.
|
|
*/
|
|
#define HW_ERR "[Hardware Error]: "
|
|
|
|
/*
|
|
* DEPRECATED
|
|
* Add this to a message whenever you want to warn user space about the use
|
|
* of a deprecated aspect of an API so they can stop using it
|
|
*/
|
|
#define DEPRECATED "[Deprecated]: "
|
|
|
|
/*
|
|
* Dummy printk for disabled debugging statements to use whilst maintaining
|
|
* gcc's format checking.
|
|
*/
|
|
#define no_printk(fmt, ...) \
|
|
({ \
|
|
if (0) \
|
|
printk(fmt, ##__VA_ARGS__); \
|
|
0; \
|
|
})
|
|
|
|
#ifdef CONFIG_EARLY_PRINTK
|
|
extern asmlinkage __printf(1, 2)
|
|
void early_printk(const char *fmt, ...);
|
|
#else
|
|
static inline __printf(1, 2) __cold
|
|
void early_printk(const char *s, ...) { }
|
|
#endif
|
|
|
|
#ifdef CONFIG_PRINTK_NMI
|
|
extern void printk_nmi_enter(void);
|
|
extern void printk_nmi_exit(void);
|
|
extern void printk_nmi_direct_enter(void);
|
|
extern void printk_nmi_direct_exit(void);
|
|
#else
|
|
static inline void printk_nmi_enter(void) { }
|
|
static inline void printk_nmi_exit(void) { }
|
|
static inline void printk_nmi_direct_enter(void) { }
|
|
static inline void printk_nmi_direct_exit(void) { }
|
|
#endif /* PRINTK_NMI */
|
|
|
|
struct dev_printk_info;
|
|
|
|
#ifdef CONFIG_PRINTK
|
|
asmlinkage __printf(4, 0)
|
|
int vprintk_emit(int facility, int level,
|
|
const struct dev_printk_info *dev_info,
|
|
const char *fmt, va_list args);
|
|
|
|
asmlinkage __printf(1, 0)
|
|
int vprintk(const char *fmt, va_list args);
|
|
|
|
asmlinkage __printf(1, 2) __cold
|
|
int printk(const char *fmt, ...);
|
|
|
|
/*
|
|
* Special printk facility for scheduler/timekeeping use only, _DO_NOT_USE_ !
|
|
*/
|
|
__printf(1, 2) __cold int printk_deferred(const char *fmt, ...);
|
|
|
|
/*
|
|
* Please don't use printk_ratelimit(), because it shares ratelimiting state
|
|
* with all other unrelated printk_ratelimit() callsites. Instead use
|
|
* printk_ratelimited() or plain old __ratelimit().
|
|
*/
|
|
extern int __printk_ratelimit(const char *func);
|
|
#define printk_ratelimit() __printk_ratelimit(__func__)
|
|
extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
|
|
unsigned int interval_msec);
|
|
|
|
extern int printk_delay_msec;
|
|
extern int dmesg_restrict;
|
|
|
|
extern int
|
|
devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write, void *buf,
|
|
size_t *lenp, loff_t *ppos);
|
|
|
|
extern void wake_up_klogd(void);
|
|
|
|
char *log_buf_addr_get(void);
|
|
u32 log_buf_len_get(void);
|
|
void log_buf_vmcoreinfo_setup(void);
|
|
void __init setup_log_buf(int early);
|
|
__printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...);
|
|
void dump_stack_print_info(const char *log_lvl);
|
|
void show_regs_print_info(const char *log_lvl);
|
|
extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold;
|
|
extern asmlinkage void dump_stack(void) __cold;
|
|
extern void printk_safe_flush(void);
|
|
extern void printk_safe_flush_on_panic(void);
|
|
#else
|
|
static inline __printf(1, 0)
|
|
int vprintk(const char *s, va_list args)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __printf(1, 2) __cold
|
|
int printk(const char *s, ...)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline __printf(1, 2) __cold
|
|
int printk_deferred(const char *s, ...)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int printk_ratelimit(void)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies,
|
|
unsigned int interval_msec)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
static inline void wake_up_klogd(void)
|
|
{
|
|
}
|
|
|
|
static inline char *log_buf_addr_get(void)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline u32 log_buf_len_get(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void log_buf_vmcoreinfo_setup(void)
|
|
{
|
|
}
|
|
|
|
static inline void setup_log_buf(int early)
|
|
{
|
|
}
|
|
|
|
static inline __printf(1, 2) void dump_stack_set_arch_desc(const char *fmt, ...)
|
|
{
|
|
}
|
|
|
|
static inline void dump_stack_print_info(const char *log_lvl)
|
|
{
|
|
}
|
|
|
|
static inline void show_regs_print_info(const char *log_lvl)
|
|
{
|
|
}
|
|
|
|
static inline void dump_stack_lvl(const char *log_lvl)
|
|
{
|
|
}
|
|
|
|
static inline void dump_stack(void)
|
|
{
|
|
}
|
|
|
|
static inline void printk_safe_flush(void)
|
|
{
|
|
}
|
|
|
|
static inline void printk_safe_flush_on_panic(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
extern int kptr_restrict;
|
|
|
|
/**
|
|
* pr_fmt - used by the pr_*() macros to generate the printk format string
|
|
* @fmt: format string passed from a pr_*() macro
|
|
*
|
|
* This macro can be used to generate a unified format string for pr_*()
|
|
* macros. A common use is to prefix all pr_*() messages in a file with a common
|
|
* string. For example, defining this at the top of a source file:
|
|
*
|
|
* #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
*
|
|
* would prefix all pr_info, pr_emerg... messages in the file with the module
|
|
* name.
|
|
*/
|
|
#ifndef pr_fmt
|
|
#define pr_fmt(fmt) fmt
|
|
#endif
|
|
|
|
/**
|
|
* pr_emerg - Print an emergency-level message
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_EMERG loglevel. It uses pr_fmt() to
|
|
* generate the format string.
|
|
*/
|
|
#define pr_emerg(fmt, ...) \
|
|
printk(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
|
|
/**
|
|
* pr_alert - Print an alert-level message
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_ALERT loglevel. It uses pr_fmt() to
|
|
* generate the format string.
|
|
*/
|
|
#define pr_alert(fmt, ...) \
|
|
printk(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
|
|
/**
|
|
* pr_crit - Print a critical-level message
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_CRIT loglevel. It uses pr_fmt() to
|
|
* generate the format string.
|
|
*/
|
|
#define pr_crit(fmt, ...) \
|
|
printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
|
|
/**
|
|
* pr_err - Print an error-level message
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_ERR loglevel. It uses pr_fmt() to
|
|
* generate the format string.
|
|
*/
|
|
#define pr_err(fmt, ...) \
|
|
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
|
|
/**
|
|
* pr_warn - Print a warning-level message
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_WARNING loglevel. It uses pr_fmt()
|
|
* to generate the format string.
|
|
*/
|
|
#define pr_warn(fmt, ...) \
|
|
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
|
|
/**
|
|
* pr_notice - Print a notice-level message
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_NOTICE loglevel. It uses pr_fmt() to
|
|
* generate the format string.
|
|
*/
|
|
#define pr_notice(fmt, ...) \
|
|
printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
|
|
/**
|
|
* pr_info - Print an info-level message
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_INFO loglevel. It uses pr_fmt() to
|
|
* generate the format string.
|
|
*/
|
|
#define pr_info(fmt, ...) \
|
|
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
|
/**
|
|
* pr_cont - Continues a previous log message in the same line.
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_CONT loglevel. It should only be
|
|
* used when continuing a log message with no newline ('\n') enclosed. Otherwise
|
|
* it defaults back to KERN_DEFAULT loglevel.
|
|
*/
|
|
#define pr_cont(fmt, ...) \
|
|
printk(KERN_CONT fmt, ##__VA_ARGS__)
|
|
|
|
/**
|
|
* pr_devel - Print a debug-level message conditionally
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to a printk with KERN_DEBUG loglevel if DEBUG is
|
|
* defined. Otherwise it does nothing.
|
|
*
|
|
* It uses pr_fmt() to generate the format string.
|
|
*/
|
|
#ifdef DEBUG
|
|
#define pr_devel(fmt, ...) \
|
|
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#else
|
|
#define pr_devel(fmt, ...) \
|
|
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#endif
|
|
|
|
|
|
/* If you are writing a driver, please use dev_dbg instead */
|
|
#if defined(CONFIG_DYNAMIC_DEBUG) || \
|
|
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
|
|
#include <linux/dynamic_debug.h>
|
|
|
|
/**
|
|
* pr_debug - Print a debug-level message conditionally
|
|
* @fmt: format string
|
|
* @...: arguments for the format string
|
|
*
|
|
* This macro expands to dynamic_pr_debug() if CONFIG_DYNAMIC_DEBUG is
|
|
* set. Otherwise, if DEBUG is defined, it's equivalent to a printk with
|
|
* KERN_DEBUG loglevel. If DEBUG is not defined it does nothing.
|
|
*
|
|
* It uses pr_fmt() to generate the format string (dynamic_pr_debug() uses
|
|
* pr_fmt() internally).
|
|
*/
|
|
#define pr_debug(fmt, ...) \
|
|
dynamic_pr_debug(fmt, ##__VA_ARGS__)
|
|
#elif defined(DEBUG)
|
|
#define pr_debug(fmt, ...) \
|
|
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#else
|
|
#define pr_debug(fmt, ...) \
|
|
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#endif
|
|
|
|
/*
|
|
* Print a one-time message (analogous to WARN_ONCE() et al):
|
|
*/
|
|
|
|
#ifdef CONFIG_PRINTK
|
|
#define printk_once(fmt, ...) \
|
|
({ \
|
|
static bool __section(".data.once") __print_once; \
|
|
bool __ret_print_once = !__print_once; \
|
|
\
|
|
if (!__print_once) { \
|
|
__print_once = true; \
|
|
printk(fmt, ##__VA_ARGS__); \
|
|
} \
|
|
unlikely(__ret_print_once); \
|
|
})
|
|
#define printk_deferred_once(fmt, ...) \
|
|
({ \
|
|
static bool __section(".data.once") __print_once; \
|
|
bool __ret_print_once = !__print_once; \
|
|
\
|
|
if (!__print_once) { \
|
|
__print_once = true; \
|
|
printk_deferred(fmt, ##__VA_ARGS__); \
|
|
} \
|
|
unlikely(__ret_print_once); \
|
|
})
|
|
#else
|
|
#define printk_once(fmt, ...) \
|
|
no_printk(fmt, ##__VA_ARGS__)
|
|
#define printk_deferred_once(fmt, ...) \
|
|
no_printk(fmt, ##__VA_ARGS__)
|
|
#endif
|
|
|
|
#define pr_emerg_once(fmt, ...) \
|
|
printk_once(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_alert_once(fmt, ...) \
|
|
printk_once(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_crit_once(fmt, ...) \
|
|
printk_once(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_err_once(fmt, ...) \
|
|
printk_once(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_warn_once(fmt, ...) \
|
|
printk_once(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_notice_once(fmt, ...) \
|
|
printk_once(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_info_once(fmt, ...) \
|
|
printk_once(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
|
|
/* no pr_cont_once, don't do that... */
|
|
|
|
#if defined(DEBUG)
|
|
#define pr_devel_once(fmt, ...) \
|
|
printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#else
|
|
#define pr_devel_once(fmt, ...) \
|
|
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#endif
|
|
|
|
/* If you are writing a driver, please use dev_dbg instead */
|
|
#if defined(DEBUG)
|
|
#define pr_debug_once(fmt, ...) \
|
|
printk_once(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#else
|
|
#define pr_debug_once(fmt, ...) \
|
|
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#endif
|
|
|
|
/*
|
|
* ratelimited messages with local ratelimit_state,
|
|
* no local ratelimit_state used in the !PRINTK case
|
|
*/
|
|
#ifdef CONFIG_PRINTK
|
|
#define printk_ratelimited(fmt, ...) \
|
|
({ \
|
|
static DEFINE_RATELIMIT_STATE(_rs, \
|
|
DEFAULT_RATELIMIT_INTERVAL, \
|
|
DEFAULT_RATELIMIT_BURST); \
|
|
\
|
|
if (__ratelimit(&_rs)) \
|
|
printk(fmt, ##__VA_ARGS__); \
|
|
})
|
|
#else
|
|
#define printk_ratelimited(fmt, ...) \
|
|
no_printk(fmt, ##__VA_ARGS__)
|
|
#endif
|
|
|
|
#define pr_emerg_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_alert_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_ALERT pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_crit_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_err_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_warn_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_notice_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
|
|
#define pr_info_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
|
|
/* no pr_cont_ratelimited, don't do that... */
|
|
|
|
#if defined(DEBUG)
|
|
#define pr_devel_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#else
|
|
#define pr_devel_ratelimited(fmt, ...) \
|
|
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#endif
|
|
|
|
/* If you are writing a driver, please use dev_dbg instead */
|
|
#if defined(CONFIG_DYNAMIC_DEBUG) || \
|
|
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
|
|
/* descriptor check is first to prevent flooding with "callbacks suppressed" */
|
|
#define pr_debug_ratelimited(fmt, ...) \
|
|
do { \
|
|
static DEFINE_RATELIMIT_STATE(_rs, \
|
|
DEFAULT_RATELIMIT_INTERVAL, \
|
|
DEFAULT_RATELIMIT_BURST); \
|
|
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, pr_fmt(fmt)); \
|
|
if (DYNAMIC_DEBUG_BRANCH(descriptor) && \
|
|
__ratelimit(&_rs)) \
|
|
__dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \
|
|
} while (0)
|
|
#elif defined(DEBUG)
|
|
#define pr_debug_ratelimited(fmt, ...) \
|
|
printk_ratelimited(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#else
|
|
#define pr_debug_ratelimited(fmt, ...) \
|
|
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
|
|
#endif
|
|
|
|
extern const struct file_operations kmsg_fops;
|
|
|
|
enum {
|
|
DUMP_PREFIX_NONE,
|
|
DUMP_PREFIX_ADDRESS,
|
|
DUMP_PREFIX_OFFSET
|
|
};
|
|
extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
|
|
int groupsize, char *linebuf, size_t linebuflen,
|
|
bool ascii);
|
|
#ifdef CONFIG_PRINTK
|
|
extern void print_hex_dump(const char *level, const char *prefix_str,
|
|
int prefix_type, int rowsize, int groupsize,
|
|
const void *buf, size_t len, bool ascii);
|
|
#else
|
|
static inline void print_hex_dump(const char *level, const char *prefix_str,
|
|
int prefix_type, int rowsize, int groupsize,
|
|
const void *buf, size_t len, bool ascii)
|
|
{
|
|
}
|
|
static inline void print_hex_dump_bytes(const char *prefix_str, int prefix_type,
|
|
const void *buf, size_t len)
|
|
{
|
|
}
|
|
|
|
#endif
|
|
|
|
#if defined(CONFIG_DYNAMIC_DEBUG) || \
|
|
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
|
|
#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
|
|
groupsize, buf, len, ascii) \
|
|
dynamic_hex_dump(prefix_str, prefix_type, rowsize, \
|
|
groupsize, buf, len, ascii)
|
|
#elif defined(DEBUG)
|
|
#define print_hex_dump_debug(prefix_str, prefix_type, rowsize, \
|
|
groupsize, buf, len, ascii) \
|
|
print_hex_dump(KERN_DEBUG, prefix_str, prefix_type, rowsize, \
|
|
groupsize, buf, len, ascii)
|
|
#else
|
|
static inline void print_hex_dump_debug(const char *prefix_str, int prefix_type,
|
|
int rowsize, int groupsize,
|
|
const void *buf, size_t len, bool ascii)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
/**
|
|
* print_hex_dump_bytes - shorthand form of print_hex_dump() with default params
|
|
* @prefix_str: string to prefix each line with;
|
|
* caller supplies trailing spaces for alignment if desired
|
|
* @prefix_type: controls whether prefix of an offset, address, or none
|
|
* is printed (%DUMP_PREFIX_OFFSET, %DUMP_PREFIX_ADDRESS, %DUMP_PREFIX_NONE)
|
|
* @buf: data blob to dump
|
|
* @len: number of bytes in the @buf
|
|
*
|
|
* Calls print_hex_dump(), with log level of KERN_DEBUG,
|
|
* rowsize of 16, groupsize of 1, and ASCII output included.
|
|
*/
|
|
#define print_hex_dump_bytes(prefix_str, prefix_type, buf, len) \
|
|
print_hex_dump_debug(prefix_str, prefix_type, 16, 1, buf, len, true)
|
|
|
|
#ifdef CONFIG_PRINTK
|
|
extern void __printk_safe_enter(void);
|
|
extern void __printk_safe_exit(void);
|
|
/*
|
|
* The printk_deferred_enter/exit macros are available only as a hack for
|
|
* some code paths that need to defer all printk console printing. Interrupts
|
|
* must be disabled for the deferred duration.
|
|
*/
|
|
#define printk_deferred_enter __printk_safe_enter
|
|
#define printk_deferred_exit __printk_safe_exit
|
|
#else
|
|
static inline void printk_deferred_enter(void)
|
|
{
|
|
}
|
|
static inline void printk_deferred_exit(void)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif
|