Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jefe: add counters to Jefe's ringbufs #1636

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/demo-stm32g0-nucleo/app-g031.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ board = "stm32g031-nucleo"

[kernel]
name = "demo-stm32g0-nucleo"
requires = {flash = 10752, ram = 1296}
requires = {flash = 10852, ram = 1296}
features = ["g031"]
stacksize = 640

[tasks.jefe]
name = "task-jefe"
priority = 0
max-sizes = {flash = 4096, ram = 512}
max-sizes = {flash = 4128, ram = 512}
start = true
stacksize = 368
notifications = ["fault", "timer"]
Expand Down
2 changes: 1 addition & 1 deletion app/demo-stm32g0-nucleo/app-g070-mini.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ size = 256
[tasks.jefe]
name = "task-jefe"
priority = 0
max-sizes = {flash = 4096, ram = 512}
max-sizes = {flash = 4128, ram = 512}
start = true
stacksize = 352
notifications = ["fault", "timer"]
Expand Down
2 changes: 1 addition & 1 deletion app/demo-stm32g0-nucleo/app-g070.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stacksize = 640
[tasks.jefe]
name = "task-jefe"
priority = 0
max-sizes = {flash = 4096, ram = 512}
max-sizes = {flash = 4128, ram = 512}
start = true
stacksize = 352
notifications = ["fault", "timer"]
Expand Down
3 changes: 1 addition & 2 deletions app/donglet/app-g031-i2c.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ stacksize = 936
[tasks.jefe]
name = "task-jefe"
priority = 0
max-sizes = {flash = 4096, ram = 512}
max-sizes = {flash = 4128, ram = 512}
start = true
stacksize = 368
notifications = ["fault", "timer"]
Expand Down Expand Up @@ -111,4 +111,3 @@ device = "tmp117"
description = "TempSense"
sensors = { temperature = 1 }
removable = true

3 changes: 1 addition & 2 deletions app/donglet/app-g031.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ stacksize = 936
[tasks.jefe]
name = "task-jefe"
priority = 0
max-sizes = {flash = 4096, ram = 512}
max-sizes = {flash = 4128, ram = 512}
start = true
stacksize = 368
notifications = ["fault", "timer"]
Expand Down Expand Up @@ -129,4 +129,3 @@ device = "tmp117"
description = "TempSense"
sensors = { temperature = 1 }
removable = true

1 change: 1 addition & 0 deletions task/jefe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cfg-if = { workspace = true }

abi = { path = "../../sys/abi" }
armv6m-atomic-hack = { path = "../../lib/armv6m-atomic-hack" }
counters = { path = "../../lib/counters" }
hubris-num-tasks = { path = "../../sys/num-tasks", features = ["task-enum"] }
ringbuf = { path = "../../lib/ringbuf" }
task-jefe-api = { path = "../jefe-api" }
Expand Down
5 changes: 3 additions & 2 deletions task/jefe/src/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ compile_error!(
except on specially designated boards"
);

#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, counters::Count)]
enum Trace {
#[count(skip)]
None,
Initialized,
GetDumpArea(u8),
Expand Down Expand Up @@ -57,7 +58,7 @@ enum Trace {
DumpDone(Result<(), humpty::DumpError<()>>),
}

ringbuf!(Trace, 8, Trace::None);
counted_ringbuf!(Trace, 8, Trace::None);

pub fn initialize_dump_areas() -> u32 {
let areas = humpty::initialize_dump_areas(
Expand Down
15 changes: 8 additions & 7 deletions task/jefe/src/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use ringbuf::*;
use userlib::*;

/// The actual requests that we honor from an external source entity
#[derive(FromPrimitive, Copy, Clone, Debug, Eq, PartialEq)]
#[derive(FromPrimitive, Copy, Clone, Debug, Eq, PartialEq, counters::Count)]
enum Request {
None = 0,
Start = 1,
Expand All @@ -63,7 +63,7 @@ enum Request {
Fault = 4,
}

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, counters::Count)]
enum Error {
IllegalTask,
BadTask,
Expand All @@ -73,15 +73,16 @@ enum Error {
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
struct TaskIndex(u16);

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, counters::Count)]
enum Trace {
#[count(skip)]
None,
Request(Request, TaskIndex),
Disposition(TaskIndex, Disposition),
Error(Error),
Request(#[count(children)] Request, TaskIndex),
Disposition(TaskIndex, #[count(children)] Disposition),
Error(#[count(children)] Error),
}

ringbuf!(Trace, 4, Trace::None);
counted_ringbuf!(Trace, 4, Trace::None);

#[no_mangle]
static JEFE_EXTERNAL_READY: AtomicU32 = AtomicU32::new(0);
Expand Down
2 changes: 1 addition & 1 deletion task/jefe/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use idol_runtime::RequestError;
use task_jefe_api::{DumpAgentError, ResetReason};
use userlib::*;

#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default, counters::Count)]
pub enum Disposition {
#[default]
Restart,
Expand Down
Loading