The timer & dwork can be statically initialized,
SYS_INIT is not strictly required.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Currently, the timer is stopped:
- in the timer handler, when the buffer is full, or
- in work handler, when time's up
In any cases, the work handler is bounded to run to print
the message, so we can kill the timer there instead.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Added:
- `clear` to discard the buffer without printing
- `info` to print info about the buffer and if the
profiler is running
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
"Perf is already running" works for `record` but is a little
strange when doing `printbuf`, so remove the "already" to
make it more universal.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The `buf_full` flag is set when it is full, but dumping the
buf currently only resets the `idx`, this means that the perf
command only works when the buffer hasn't been full before.
Reset the flag when we clear the buffer.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
`PERF_EVENT_TRACING_BUF_OVERFLOW` isn't used, remove it.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
`cmd_perf` isn't doing anything meaningful, remove it so that
the help message will be printed when invoked. Updated
the help message of the main command.
```
uart:~$ perf
perf - Lightweight profiler
Subcommands:
record : Start recording for <duration> ms on <frequency> Hz
Usage: record <duration> <frequency>
printbuf : Print the perf buffer
```
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
static perf_data is zero-initialized by default, there's no
need to explicitly set `idx` to `0`.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Add missing braces to comply with MISRA C:2012 Rule 15.6 and
also following Zephyr's style guideline.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This assert cannot be turned on, as `pdu` will be NULL sometimes. This
is okay, it just means that the current channel doesn't have anything to
send and that we should probably try another one.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Adds commands for triggering conn_mgr functions and
tweaking conn_mgr connectivity flags.
Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
Add basic WPA2 EAP-TLS support.
Also, add test infrasturcture esp. the certification handling,
non-certificate credentials are take as runtime input and certificated
are build time input for testing.
A real application can set certificates at runtime too.
Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
TX time tracing tells how long it took from network packet
creation to when the stack got rid of it.
So the network stack allocates net packet, this is the
start time. The end time is when the packet is fully processed (sent)
by the network device driver.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
RX time tracing tells how long it took from network packet
creation to when the stack got rid of it.
So the network device driver allocates net packet, this is the
start time. The end time is when the packet is fully processed.
Currently the limitation is that the RX time duration is used
for network packets that are tied to an open socket.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When user_data is not zeroed-out, the API returns an error. Downgrade
the API error to a warning log instead.
Introducing this check (#76489) broke a few PTS tests, as user_data is
not initialized by `net_buf_alloc()`. Doing so is in discussion:
https://github.com/zephyrproject-rtos/zephyr/issues/77088
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
For two reasons:
- prevent exposing the previous user's info to the new user
- make NULL checks on user_data work
Since we don't really have a field that specifies what part of the
user_data array is valid, we have to rely on other checks.
Such a check, if user_data contains a callback, is comparing against
NULL before calling said callback.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Path loss monitoring does not work without LE Power Control
also enabled in the controller, so update the dependencies
in the kconfigs so path loss monitoring selects power
control.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
callback_list was renamed to conn_cbs in commit 3eb975d.
However plm callback was missed due to it not being built
anywhere.
Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
Transmit/write buffers are expected to be constant values given to the
operation to transmit but not mutate. Seperate the OP_TX and OP_RX
operation description unions.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
This log message does not need to be repeated 10 times at the INFO level
when the same information is provided after all the retries are done:
```
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Legacy card detected, no CMD8 support
<inf> sd: Card does not support CMD8, assuming legacy card
```
to
```
<inf> sd: Card does not support CMD8, assuming legacy card
```
Signed-off-by: Jordan Yates <jordan@embeint.com>
Clean up documentation pages for the new perf tool
as they contained several typos, grammar errors, and
duplicated content between main doc page and sample
page
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Trigger the TX processor on connection teardown.
When a disconnection happens before the controller has acknowledged some
ACL fragments the host has sent, we run `process_unack_tx()` to free
those unacknowledged buffers and their associated TX contexts.
The problem is that the TX processor still holds a reference to the conn
object. That reference is not released until the TX processor is
triggered again and figures out that the connection is invalid.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Fix missing invalid aux offset check that was being caught
in a development assertion check. If aux offset where less
than the PDU time of the primary channel PDU, radio was
redundantly being setup delayed for reception that was
being caught in an assertion check.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Notify only if the device configuration has changed. Pass only the
configuration value as the message status, the actual device speed can
be obtained with usbd_bus_speed().
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This test create a setup where an ISO broadcaster will send fragmented
data and get stopped after sending the first fragment and repeating that
operation multiple time to verify that buffers are not leaked.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
When sending data using ISO and the data is fragmented, if the
connection is cut before all the fragments are sent, the data buffer
will be leaked.
Fix the issue by unref'ing the buffer when ISO is not in a connected
state.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
When disconnected while sending data, if ISO doesn't get the number of
completed packets it will not call `process_unack_tx` and thus will leak
TX context.
Fix that by setting the connection state in ISO disconnection which will
trigger a call to `process_unack_tx`.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
It should have reffered to the architecture,
not one of its board's name.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Convert users of net_buf_put() and net_buf_get() functions to use
non-wrapped putters and getters k_fifo_put() and k_fifo_get().
Special handling of net_bufs in k_fifos is no longer needed after commit
3d306c181f, since these actions are now
atomic regardless of any net_buf fragments.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Replace `shell_fprintf(sh, SHELL_ERROR, ...)` with
`shell_error(sh, ...)` since it brings the same underlying
action with less typing.
Note: `shell_error` already concatenates `\n` to format strings,
so we remove `\n` from the original code.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Utilize a code spell-checking tool to scan for and correct spelling errors
in `subsys/testsuite/ztest/src/ztest.c` file.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
It's usual to show debug logs as blue.
Showing dbg and info with different colors are good,
but it's preferable to keep info logs with default
color.
Signed-off-by: Félix Piédallu <felix@piedallu.me>
LwM2M SEND functionality is defined in LwM2M v1.1
So quard the condition with protocol version, not
server object version.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The Host Interface Type in the DEVCNT register sets the HIF type
(either eSPI or LPC).
Currently, it is configured in the host-interface-related drivers like
eSPI or SHI. However, some I/O pads sourced from VHIF in the other
modules such as GPIO and I3C also rely on this field. It might be
problematic when using those I/Os without enabling eSPI or SHI drivers.
This commit moves the setting from the specific drivers to the global
system initialization function scfg_init().
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>