History log of /freebsd/sys/kern/subr_prf.c (Results 1 – 25 of 405)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/14.2.0, release/13.4.0
# d4f9e326 31-Aug-2024 Ahmad Khalifa <ahmadkhalifa570@gmail.com>

libc/stdio: Increase BUF in vfprintf.c and vfwprintf.c

With the %b format specifier we need enough space to write a uintmax_t
in binary.

Reviewed by: imp
Pull Request: https://github.com/freebsd/fr

libc/stdio: Increase BUF in vfprintf.c and vfwprintf.c

With the %b format specifier we need enough space to write a uintmax_t
in binary.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1400

show more ...


# df79daa0 03-Sep-2024 Craig Woodward <Craig.Woodward@redcom.com>

Reduce additional console output when muted

While trying to resolve some custom installer issues, we found that
using conscontrol(8) or setting kern.always_console_output=0 in
sysctrl.conf(5) did no

Reduce additional console output when muted

While trying to resolve some custom installer issues, we found that
using conscontrol(8) or setting kern.always_console_output=0 in
sysctrl.conf(5) did not always prevent console output. This is in part
because some areas of the kernel were outputting to the console device
without checking the status of the setting. These changes enforce
checking of the value in both locations where console output occurs from
kernel and init(8) based callouts.

Details on changes:

- Moves check for mute to earlier in sequence to silence kernel output
even if EARLY_PRINTF is defined.
- Modifies call prf_putbuf() and prf_putchar() in subr_prf.c to strip
TOCONS flag if muting is enabled, to honor the setting at print
level.

This is a rather simple change, which increases areas where flags to
silence console output are honored. We have been running this change
since 10/23 in-house without issue. (Patching prior to 14.0 also
required making cn_mute non-static.)

Signed-off-by: Craig.Woodward@redcom.com
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1407

show more ...


# 07d90ee0 14-Jun-2024 Sebastian Huber <sebastian.huber@embedded-brains.de>

kvprintf(): Fix '+' conversion handling

For example, printf("%+i", 1) prints "+1". However, kvprintf() did
print just "1" for this example. According to PRINTF(3):

A sign must always be placed

kvprintf(): Fix '+' conversion handling

For example, printf("%+i", 1) prints "+1". However, kvprintf() did
print just "1" for this example. According to PRINTF(3):

A sign must always be placed before a number produced by a signed
conversion.

For "%+r" radix conversions, keep the "+" handling as it is, since this
is a non-standard conversion. For "%+p" pointer conversions, continue
to ignore the sign modifier to be in line with libc.

This change allows to support the ' conversion modifier in the future.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1310

show more ...


# fc3e5334 13-Jun-2024 Sebastian Huber <sebastian.huber@embedded-brains.de>

Fix "%hhi" conversion for kvprintf()

The signedness of "char" is implementation-dependent.

Reviewed by: imp,zlei,nightquick@proton.me
Pull Request: https://github.com/freebsd/freebsd-src/pull/1290


Revision tags: release/14.1.0, release/13.3.0
# 61cc4830 18-Jan-2024 Alfredo Mazzinghi <am2419@cl.cam.ac.uk>

Abstract UIO allocation and deallocation.

Introduce the allocuio() and freeuio() functions to allocate and
deallocate struct uio. This hides the actual allocator interface, so it
is easier to modify

Abstract UIO allocation and deallocation.

Introduce the allocuio() and freeuio() functions to allocate and
deallocate struct uio. This hides the actual allocator interface, so it
is easier to modify the sub-allocation layout of struct uio and the
corresponding iovec array.

Obtained from: CheriBSD
Reviewed by: kib, markj
MFC after: 2 weeks
Sponsored by: CHaOS, EPSRC grant EP/V000292/1
Differential Revision: https://reviews.freebsd.org/D43711

show more ...


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 0a713948 22-Nov-2023 Alexander Motin <mav@FreeBSD.org>

Replace random sbuf_printf() with cheaper cat/putc.


Revision tags: release/14.0.0
# c545a7b2 14-Oct-2023 Chuck Silvers <chs@FreeBSD.org>

prf: add setting of msgbuftrigger in paths where it is missing

Logging things to msgbuf is supposed to set msgbuftrigger so that
syslogd will notice that there is more to read from /dev/klog,
but se

prf: add setting of msgbuftrigger in paths where it is missing

Logging things to msgbuf is supposed to set msgbuftrigger so that
syslogd will notice that there is more to read from /dev/klog,
but several paths do not do that. Add the missing trigger.

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D42173

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 9d6ae1e3 05-Jun-2023 Colin Percival <cperciva@FreeBSD.org>

Revert "Revert "tslog: Annotate some early boot functions""

Now that <sys/tslog.h> is wrapped in #ifdef _KERNEL, it's safe to have
tslog annotations in files which might be built from userland (i.e.

Revert "Revert "tslog: Annotate some early boot functions""

Now that <sys/tslog.h> is wrapped in #ifdef _KERNEL, it's safe to have
tslog annotations in files which might be built from userland (i.e. in
subr_boot.c, which is built as part of the boot loader).

This reverts commit 59588a546f55523d6fd37ab42eb08b719311d7d6.

show more ...


# 59588a54 04-Jun-2023 Colin Percival <cperciva@FreeBSD.org>

Revert "tslog: Annotate some early boot functions"

The change to subr_boot.c broke the libsa build because the TSLOG
macros have their own definitions for the boot loader -- I didn't
realize that th

Revert "tslog: Annotate some early boot functions"

The change to subr_boot.c broke the libsa build because the TSLOG
macros have their own definitions for the boot loader -- I didn't
realize that the loader code used subr_boot.c.

I'm currently testing a fix and I'll revert this revert once I'm
satisfied that everything works, but I don't want to leave the
tree broken for too long.

This reverts commit 469cfa3c30ee7a5ddeb597d0a8c3e7cac909b27a.

show more ...


# 469cfa3c 22-May-2023 Colin Percival <cperciva@FreeBSD.org>

tslog: Annotate some early boot functions

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
hammer_time takes roughly 2740 us:
* 55 us in xen_pvh_parse_preload_data
* 20 us in b

tslog: Annotate some early boot functions

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
hammer_time takes roughly 2740 us:
* 55 us in xen_pvh_parse_preload_data
* 20 us in boot_parse_cmdline_delim
* 20 us in boot_env_to_howto
* 15 us in identify_hypervisor
* 1320 us in link_elf_reloc
* 1310 us in relocate_file1 handling ef->rela
* 25 us in init_param1
* 30 us in dpcpu_init
* 355 us in initializecpu
* 255 us in initializecpu calling load_cr4
* 425 us in getmemsize
* 280 us in pmap_bootstrap
* 205 us in create_pagetables
* 10 us in init_param2
* 25 us in pci_early_quirks
* 60 us in cninit
* 90 us in kdb_init
* 105 us in msgbufinit
* 20 us in fpuinit
* 205 us elsewhere in hammer_time

Some of these are unavoidable (e.g. identify_hypervisor uses CPUID and
load_cr4 loads the CR4 register, both of which trap to the hypervisor)
but others may deserve attention.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40325

show more ...


Revision tags: release/13.2.0, release/12.4.0
# c84c5e00 18-Jul-2022 Mitchell Horne <mhorne@FreeBSD.org>

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Spons

ddb: annotate some commands with DB_CMD_MEMSAFE

This is not completely exhaustive, but covers a large majority of
commands in the tree.

Reviewed by: markj
Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D35583

show more ...


Revision tags: release/13.1.0
# c999e348 05-Feb-2022 Gleb Smirnoff <glebius@FreeBSD.org>

dmesg: detect wrapped msgbuf on the kernel side and if so, skip first line

Since 59f256ec35d3 dmesg(8) will always skip first line of the message
buffer, cause it might be incomplete. The problem i

dmesg: detect wrapped msgbuf on the kernel side and if so, skip first line

Since 59f256ec35d3 dmesg(8) will always skip first line of the message
buffer, cause it might be incomplete. The problem is that in most cases
it is complete, valid and contains the "---<<BOOT>>---" marker. This
skip can be disabled with '-a', but that would also unhide all non-kernel
messages. Move this functionality from dmesg(8) to kernel, since kernel
actually knows if wrap has happened or not.

The main motivation for the change is not actually the value of the
"---<<BOOT>>---" marker. The problem breaks unit tests, that clear
message buffer, perform a test and then check the message buffer for
a result. Example of such test is sys/kern/sonewconn_overflow.

show more ...


Revision tags: release/12.3.0
# a264594d 04-Sep-2021 Alexander Motin <mav@FreeBSD.org>

Unify console output.

Without this change when virtual console enabled depending on buffer
presence and state different parts of output go to different consoles.

MFC after: 1 month


Revision tags: release/13.0.0
# 679e4cda 22-Jan-2021 Marius Strobl <marius@FreeBSD.org>

kvprintf(9): add missing FALLTHROUGH

Reported by: Coverity
CID: 1005166


# 7e99c034 20-Jan-2021 Alex Richardson <arichardson@FreeBSD.org>

Emit uprintf() output for initproc if there is no controlling terminal

This patch helped me debug why /sbin/init was not being loaded after
making changes to the image activator in CheriBSD.

Review

Emit uprintf() output for initproc if there is no controlling terminal

This patch helped me debug why /sbin/init was not being loaded after
making changes to the image activator in CheriBSD.

Reviewed By: jhb (earlier version), kib
Differential Revision: https://reviews.freebsd.org/D28121

show more ...


Revision tags: release/12.2.0, release/11.4.0
# 937b352e 09-May-2020 Ed Maste <emaste@FreeBSD.org>

remove %n support from printf(9)

It can be dangerous and there is no need for it in the kernel.
Inspired by Kees Cook's change in Linux, and later OpenBSD.

Reviewed by: cem, gordon, philip
Sponsore

remove %n support from printf(9)

It can be dangerous and there is no need for it in the kernel.
Inspired by Kees Cook's change in Linux, and later OpenBSD.

Reviewed by: cem, gordon, philip
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24760

show more ...


# 879e0604 12-Jan-2020 Mateusz Guzik <mjg@FreeBSD.org>

Add KERNEL_PANICKED macro for use in place of direct panicstr tests


Revision tags: release/12.1.0, release/11.3.0
# 7648bc9f 13-May-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @347527

Sponsored by: The FreeBSD Foundation


# 7d7db529 07-May-2019 Conrad Meyer <cem@FreeBSD.org>

device_printf: Use sbuf for more coherent prints on SMP

device_printf does multiple calls to printf allowing other console messages to
be inserted between the device name, and the rest of the messag

device_printf: Use sbuf for more coherent prints on SMP

device_printf does multiple calls to printf allowing other console messages to
be inserted between the device name, and the rest of the message. This change
uses sbuf to compose to two into a single buffer, and prints it all at once.

It exposes an sbuf drain function (drain-to-printf) for common use.

Update documentation to match; some unit tests included.

Submitted by: jmg
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D16690

show more ...


Revision tags: release/12.0.0
# c6879c6c 23-Oct-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r339015 through r339669.


# 6858c2cc 20-Oct-2018 Conrad Meyer <cem@FreeBSD.org>

Replace ttyprintf with sbuf_printf and tty drain routine

Add string variants of cnputc and tty_putchar, and use them from the tty
sbuf drain routine.

Suggested by: ed@
Sponsored by: Dell EMC Isilon


# b19d66fd 17-Oct-2018 Jamie Gritton <jamie@FreeBSD.org>

Add a new jail permission, allow.read_msgbuf. When true, jailed processes
can see the dmesg buffer (this is the current behavior). When false (the
new default), dmesg will be unavailable to jailed

Add a new jail permission, allow.read_msgbuf. When true, jailed processes
can see the dmesg buffer (this is the current behavior). When false (the
new default), dmesg will be unavailable to jailed users, whether root or
not.

The security.bsd.unprivileged_read_msgbuf sysctl still works as before,
controlling system-wide whether non-root users can see the buffer.

PR: 211580
Submitted by: bz
Approved by: re@ (kib@)
MFC after: 3 days

show more ...


# 3611ec60 18-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r337646 through r338014.


12345678910>>...17