{"id":20713210,"url":"https://github.com/linaro/aerology","last_synced_at":"2025-04-23T08:02:18.236Z","repository":{"id":38821593,"uuid":"473235944","full_name":"Linaro/aerology","owner":"Linaro","description":"Inspect Zephyr and TFM applications, post mortem","archived":false,"fork":false,"pushed_at":"2025-01-24T03:16:41.000Z","size":1211,"stargazers_count":23,"open_issues_count":2,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-29T23:01:47.608Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://linaro.github.io/aerology/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Linaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-23T14:57:20.000Z","updated_at":"2025-02-11T17:59:06.000Z","dependencies_parsed_at":"2022-09-09T14:51:01.216Z","dependency_job_id":null,"html_url":"https://github.com/Linaro/aerology","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linaro%2Faerology","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linaro%2Faerology/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linaro%2Faerology/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Linaro%2Faerology/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Linaro","download_url":"https://codeload.github.com/Linaro/aerology/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250395253,"owners_count":21423395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T02:23:59.391Z","updated_at":"2025-04-23T08:02:18.209Z","avatar_url":"https://github.com/Linaro.png","language":"Rust","readme":"# Aerology\n\nInspect Zephyr and TF-M applications, post mortem.\n\nAerology allows for analysis and inspection of symbols and stacks from a core\ndump taken from a running zephyr application.\n\n/!\\ Warning /!\\\n\nThis software is at a very early stage of development and the command line\ninterface will change without notice, possibly more than once a day.\nFurther, the documentation is sparse at best.\n\n# What does it do?\n\nCurrently aerology allows a user to do the following with a core dump of\nzephyr:\n  * Pack build diectorys into \"zap\" zephyr app packages\n  * print DTS and Config\n  * Take core dumps over gdb remot protocol\n  * disassemble functions\n  * print symbol type and size info\n  * visualize memory layout from segments \u0026 program headers\n  * query symbols to print values\n  * visualize stack usage\n  * Take backtraces from all threads in zephyr \u0026 tfm\n  \n# Building\n\naerology is built with rust and cargo.\nSee [rustup.rs](https://rustup.rs) for rust install instructions.\nOnce you have rustup, install the native toolchain for your platform\n and build aerology.\n\n```\n    ;rustup update\n    ;cargo install --path .\n```\n\n# How do I use it?\n\nThe current workflow looks something like:\n\n1) Do a west build\n2) Package the west build into a zap with `aerology pack \u003cbuild-dir\u003e`\n3) Run your application in qemu (support for other gdb servers pending)\n4) Take a core dump with `aerology dump \u003czap\u003e`\n5) Inspect the core dump with the remaining subcommands, e.g. `aerology backtrace \u003ccore\u003e`\n\n# Exmaple output\n\nPretty-Print all of the tfm partition control context structures:\n\n```\n    ;aerology query dhcpv4_client.core.0 'partition_listhead =\u003e llnodes. next =\u003e .ctx_ctrl'\n3000bf60: (struct context_ctrl_t) {\n    .sp = (uint32_t) 805347216 /*0x30009f90*/,\n    .sp_limit = (uint32_t) 805339336 /*0x300080c8*/,\n    .reserved = (uint32_t) 805347288 /*0x30009fd8*/,\n    .exc_ret = (uint32_t) 4294967293 /*0xfffffffd*/,\n}\n3000bfa8: (struct context_ctrl_t) {\n    .sp = (uint32_t) 805350664 /*0x3000ad08*/,\n    .sp_limit = (uint32_t) 805348168 /*0x3000a348*/,\n    .reserved = (uint32_t) 805350736 /*0x3000ad50*/,\n    .exc_ret = (uint32_t) 4294967293 /*0xfffffffd*/,\n}\n3000bff0: (struct context_ctrl_t) {\n    .sp = (uint32_t) 805321152 /*0x300039c0*/,\n    .sp_limit = (uint32_t) 805319272 /*0x30003268*/,\n    .reserved = (uint32_t) 805321224 /*0x30003a08*/,\n    .exc_ret = (uint32_t) 4294967293 /*0xfffffffd*/,\n}\n3000c038: (struct context_ctrl_t) {\n    .sp = (uint32_t) 805352976 /*0x3000b610*/,\n    .sp_limit = (uint32_t) 805351488 /*0x3000b040*/,\n    .reserved = (uint32_t) 805353048 /*0x3000b658*/,\n    .exc_ret = (uint32_t) 4294967293 /*0xfffffffd*/,\n}\n3000c080: (struct context_ctrl_t) {\n    .sp = (uint32_t) 805354312 /*0x3000bb48*/,\n    .sp_limit = (uint32_t) 805353152 /*0x3000b6c0*/,\n    .reserved = (uint32_t) 805354384 /*0x3000bb90*/,\n    .exc_ret = (uint32_t) 4294967293 /*0xfffffffd*/,\n}\n3000c0c8: (struct context_ctrl_t) {\n    .sp = (uint32_t) 805356952 /*0x3000c598*/,\n    .sp_limit = (uint32_t) 805356000 /*0x3000c1e0*/,\n    .reserved = (uint32_t) 0 /*0x0*/,\n    .exc_ret = (uint32_t) 4294967293 /*0xfffffffd*/,\n}\n3000c110: (struct context_ctrl_t) {\n    .sp = (uint32_t) 805357208 /*0x3000c698*/,\n    .sp_limit = (uint32_t) 805357024 /*0x3000c5e0*/,\n    .reserved = (uint32_t) 0 /*0x0*/,\n    .exc_ret = (uint32_t) 4294967293 /*0xfffffffd*/,\n}\n```\n\nBacktrace all threads in Zephyr and TF-M\n\n```\n    ;aerology backtrace dhcpv4_client.core.0\nThread zephyr::idle 00\n  ├─ 0106bad4 in z_thread_entry\n  └─ aaaaaaaa in \u003cunknown\u003e\nThread zephyr::logging\n  ├─ 0106bad4 in z_thread_entry\n  └─ aaaaaaaa in \u003cunknown\u003e\nThread zephyr::main\n  ├─ 010644f8 in arch_swap\n  ├─ 0106b8dd in k_sys_work_q_init\n  ├─ 01069fe5 in z_sys_init_run_level\n  ├─ 0106a1af in bg_thread_main\n  ├─ 0106bae1 in z_thread_entry\n  └─ 010645e3 in arch_switch_to_main_thread\nThread zephyr::shell_uart\n  ├─ 0106bad4 in z_thread_entry\n  └─ aaaaaaaa in \u003cunknown\u003e\nThread tfm_s::3000bf40\n  ├─ 11008e70 in tfm_arch_trigger_pendsv\n  ├─ 11007ee3 in spm_interface_thread_dispatcher\n  └─ 11021187 in psa_interface_unified_abi\nThread tfm_s::3000bf88\n  ├─ 11008e70 in tfm_arch_trigger_pendsv\n  ├─ 11007ee3 in spm_interface_thread_dispatcher\n  └─ 11021187 in psa_interface_unified_abi\nThread tfm_s::3000bfd0\n  ├─ 11008e70 in tfm_arch_trigger_pendsv\n  ├─ 11007ee3 in spm_interface_thread_dispatcher\n  └─ 11021187 in psa_interface_unified_abi\nThread tfm_s::3000c018\n  ├─ 11008e70 in tfm_arch_trigger_pendsv\n  ├─ 11007ee3 in spm_interface_thread_dispatcher\n  └─ 11021187 in psa_interface_unified_abi\nThread tfm_s::3000c060\n  ├─ 11008e70 in tfm_arch_trigger_pendsv\n  ├─ 11007ee3 in spm_interface_thread_dispatcher\n  └─ 11021187 in psa_interface_unified_abi\nThread tfm_s::3000c0a8\n  └─ 11008c85 in tfm_nspm_thread_entry\nThread tfm_s::3000c0f0\n  └─ 11008ca5 in tfm_idle_thread\n```\n\nShow a summary of the segments described by the zap metadata:\n\n```\n    ;aerology segments -s dhcpv4_client.core.0\nNote: Not to scale.\nKey: r = readable, w = writable, x = executable, z = zeroed on startup\n     ┃ = overlapping section\n           zephyr      tfm_s        bl2\n31007928┌──────────┐\n        │       rwz│\n31000418└──────────┘\n31000414┌──────────┐\n        │        rw│\n31000000└──────────┘\n3000ff70            ┌──────────┐\n                    │       rwz│\n3000bf38            ┢━━━━━━━━━━┪\n                    ┃        rw┃\n3000bbc0            ┡━━━━━━━━━━┩\n30005f40            │          │┌──────────┐\n                    │          ││        rw│\n30003ac0            ┢━━━━━━━━━━┪│          │\n                    ┃        rw┃│          │\n30003a80            ┡━━━━━━━━━━┩│          │\n30002020            ┢━━━━━━━━━━┪│          │\n                    ┃        rw┃│          │\n30002000            ┡━━━━━━━━━━┩│          │\n30000400            │          │├──────────┤\n                    │          ││       rwz│\n30000000            └──────────┘└──────────┘\n11076384┌──────────┐\n        │       rwx│\n11060000└──────────┘\n1105f500            ┌──────────┐\n                    │        rx│\n1105f4c0            └──────────┘\n11021280            ┌──────────┐\n                    │        rx│\n11009fe0            └──────────┘\n11009f68            ┌──────────┐\n                    │       rwx│\n11000000            └──────────┘\n100055e0                        ┌──────────┐\n                                │       rwx│\n10000000                        └──────────┘\n```\n\nShow the stack usage of all threads:\n```\n    ;aerology stacks dhcpv4_client.core.0\nKey: █: currently in use ▒: used in the past ░: never used\nname                 used    max   size\nzephyr::logging       32b    32b   768b ░░░\nzephyr::shell_uart    32b    32b  2048b ░░░░░░░░\nzephyr::idle 00       32b    32b   320b ░\nzephyr::main          88b   216b  1024b ░░░░\ntfm_s::3000bf40      312b  2440b  8192b █▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░\ntfm_s::3000bf88      192b   192b  2688b ░░░░░░░░░░░\ntfm_s::3000bfd0      168b   776b  2048b ▒▒▒░░░░░\ntfm_s::3000c018      176b   644b  1664b ▒▒░░░░░\ntfm_s::3000c060      120b   256b  1280b ▒░░░░\ntfm_s::3000c0a8       72b   300b  1024b ▒░░░\ntfm_s::3000c0f0       72b    20b   256b ░\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinaro%2Faerology","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinaro%2Faerology","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinaro%2Faerology/lists"}