Skip to content

[DO NOT MERGE] SSM fin notify ,fin wait example test case - #7485

Open
anjana348 wants to merge 1 commit into
Samsung:masterfrom
anjana348:ssm
Open

[DO NOT MERGE] SSM fin notify ,fin wait example test case#7485
anjana348 wants to merge 1 commit into
Samsung:masterfrom
anjana348:ssm

Conversation

@anjana348

Copy link
Copy Markdown
Contributor

Demonstrates the /dev/crashrpt driver. At startup it builds diagnostic data in memory (500 nodes × 48 bytes + 50 nodes × 64 bytes, each with a message up to 255 bytes). It spawns a high-priority "reporter" thread that registers with the kernel and parks in fin_wait(). When an assert fires, the kernel (at the top of up_assert()) wakes the reporter, which writes the diagnostics to a file (/tmp/crashrpt_r<N>.bin) before the board reboots. The file is written to a temp path and rename()'d only after flush+close, so readers never see a partial report.

Sub-commands (run from TASH shell):
| Command | Action |
| crashrpt_test init | Build the diagnostic data + start & register the reporter thread | | crashrpt_test status | Show what's registered and the max report size | | crashrpt_test crash | Raise ASSERT(0) to exercise the full capture path → reporter writes file → reboot |

Configs to enable:
| Config | Purpose | Default |
| CONFIG_CRASH_REPORT=y | Required — enables the kernel driver (os/drivers/crashrpt.c), the /dev/crashrpt device, and the up_assert() hook | n | | CONFIG_CRASH_REPORT_DEADLINE_MS=3000 | Max ms the asserter blocks waiting for the reporter | 3000 | | CONFIG_EXAMPLES_CRASHRPT_TEST=y | Builds this example app | n | | CONFIG_EXAMPLES_CRASHRPT_TEST_DIR="/tmp" | Directory where the report file is written | "/tmp" | | CONFIG_EXAMPLES_CRASHRPT_TEST_PRIORITY=254 | Reporter thread priority (must be high — SCHED_PRIORITY_MAX-1) | SCHED_PRIORITY_MAX-1 | | CONFIG_EXAMPLES_CRASHRPT_TEST_STACKSIZE=8192 | Reporter thread stack size | 8192 |

TASH>> crashrpt_test init # builds data, registers reporter
TASH>> crashrpt_test status # (optional) check state
TASH>> crashrpt_test crash # triggers ASSERT(0) → reporter writes /tmp/crashrpt_r0.bin → reboot

Demonstrates the `/dev/crashrpt` driver. At startup it builds diagnostic data in memory (500 nodes × 48 bytes + 50 nodes × 64 bytes, each with a message up to 255 bytes). It spawns a high-priority "reporter" thread that registers with the kernel and parks in `fin_wait()`. When an assert fires, the kernel (at the top of `up_assert()`) wakes the reporter, which writes the diagnostics to a file (`/tmp/crashrpt_r<N>.bin`) before the board reboots. The file is written to a temp path and `rename()`'d only after flush+close, so readers never see a partial report.

**Sub-commands (run from TASH shell):**
| Command | Action |
| `crashrpt_test init` | Build the diagnostic data + start & register the reporter thread |
| `crashrpt_test status` | Show what's registered and the max report size |
| `crashrpt_test crash` | Raise `ASSERT(0)` to exercise the full capture path → reporter writes file → reboot |

**Configs to enable:**
| Config | Purpose | Default |
| `CONFIG_CRASH_REPORT=y` | **Required** — enables the kernel driver (`os/drivers/crashrpt.c`), the `/dev/crashrpt` device, and the `up_assert()` hook | n |
| `CONFIG_CRASH_REPORT_DEADLINE_MS=3000` | Max ms the asserter blocks waiting for the reporter | 3000 |
| `CONFIG_EXAMPLES_CRASHRPT_TEST=y` | Builds this example app | n |
| `CONFIG_EXAMPLES_CRASHRPT_TEST_DIR="/tmp"` | Directory where the report file is written | "/tmp" |
| `CONFIG_EXAMPLES_CRASHRPT_TEST_PRIORITY=254` | Reporter thread priority (must be high — `SCHED_PRIORITY_MAX-1`) | SCHED_PRIORITY_MAX-1 |
| `CONFIG_EXAMPLES_CRASHRPT_TEST_STACKSIZE=8192` | Reporter thread stack size | 8192 |

TASH>> crashrpt_test init      # builds data, registers reporter
TASH>> crashrpt_test status    # (optional) check state
TASH>> crashrpt_test crash     # triggers ASSERT(0) → reporter writes /tmp/crashrpt_r0.bin → reboot
@anjana348 anjana348 changed the title apps/crashrpt_test: fin notify , fin wait example test case [DO NOT MERGE] apps/crashrpt_test: fin notify , fin wait example test case Aug 14, 2026
@anjana348 anjana348 changed the title [DO NOT MERGE] apps/crashrpt_test: fin notify , fin wait example test case [DO NOT MERGE] SSM fin notify ,fin wait example test case Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant