{"id":24092429,"url":"https://github.com/RT-Thread-packages/kdb","last_synced_at":"2025-09-17T01:34:09.558Z","repository":{"id":55094623,"uuid":"327786231","full_name":"RT-Thread-packages/kdb","owner":"RT-Thread-packages","description":"kernel debug log tool","archived":false,"fork":false,"pushed_at":"2021-01-11T06:48:24.000Z","size":16,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2023-03-10T11:17:27.455Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/RT-Thread-packages.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":"2021-01-08T03:14:29.000Z","updated_at":"2022-05-25T13:14:05.000Z","dependencies_parsed_at":"2022-08-14T11:50:17.196Z","dependency_job_id":null,"html_url":"https://github.com/RT-Thread-packages/kdb","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fkdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fkdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fkdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RT-Thread-packages%2Fkdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RT-Thread-packages","download_url":"https://codeload.github.com/RT-Thread-packages/kdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233313214,"owners_count":18657173,"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":"2025-01-10T07:44:59.872Z","updated_at":"2025-09-17T01:34:04.166Z","avatar_url":"https://github.com/RT-Thread-packages.png","language":"C","readme":"# KDB使用方法及相关API文档\n\n## 简介\n\nKernel Debug Tool 简称 KDB。是一种内核信息追踪工具。当我们查找程序漏洞时，需要查看系统运行的各种信息。如：线程创建时间，线程切换，内存的分配与回收，信号量，互斥量，邮箱，事件等IPC 变量的使用。通过这些内核活动信息来对程序进行分析，有效查找程序漏洞。\n\n## 使用方法\n\n本节将介绍KDB软件包的使用方法。\n\n### 帮助信息\n\n```\nmsh /\u003ekdb -h\nkdb\nkdb -h        des: print help\nkdb -s        des: start take notes\nkdb -d        des: dump take notes\nkdb -ii       des: is inval\nkdb --stop    des: stop takle notes\n```\n通过命令行调用kdb，了解kdb的使用信息。\n\n### 开启kdb\n\n```\nmsh /\u003ekdb -s\nrtx start...\n```\n开启KDB工具，记录内核信息。\n\n### 中止kdb\n\n```\nmsh /\u003ekdb --stop\nrtx stop.\n```\n将kdb工具中止，终止后工具不再记录内核信息。\n\n### 打印kdb记录信息\n\n```\nmsh /\u003ekdb -d\n[tick]:2304 thread scheduler tidle0 -\u003e tshell\n[tick]:2304 thread resume tshell\n[tick]:2274 thread scheduler tshell -\u003e tidle0\n[tick]:2274 thread suspend tshell\n[tick]:2274 thread scheduler tidle0 -\u003e tshell\n[tick]:2274 thread resume tshell\n[tick]:2264 thread scheduler tshell -\u003e tidle0\n[tick]:2264 thread suspend tshell\n[tick]:2264 thread scheduler tidle0 -\u003e tshell\n[tick]:2264 thread resume tshell\n...\n\n```\n将kdb工具的储存的信息打印出来\n\n\n## KDB API\n\n本节讲介绍kdb工具所提供的API\n\n`int kdb_sys_init(void);`\n\n\u003e 用于初始化kdb工具。\n\n`void kdb_sys_start(void);`\n\n\u003e 启动kdb并且开始记录内核活动信息。\n\n`void kdb_sys_stop(void);`\n\n\u003e 中止记录内核活动信息。\n\n`void kdb_sys_dump(void);`\n\n\u003e 将记录的内核活动信息打印出来。\n\n`void kdb_sys_stop_dump(void);`\n\n\u003e 停止kdb工作，并将内核活动信息打印出来。\n\n","funding_links":[],"categories":["Packages"],"sub_categories":["Tools"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRT-Thread-packages%2Fkdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRT-Thread-packages%2Fkdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRT-Thread-packages%2Fkdb/lists"}