do_dump_sa

- module
- ucli
This commit is contained in:
zy
2023-12-12 04:05:56 -05:00
parent 96462422ce
commit 69bf4c8c69
7 changed files with 155 additions and 75 deletions

View File

@@ -119,6 +119,23 @@ static void do_dump(const char *arg) {
}
}
static void do_dump_sa(const char *arg) {
static char variant_buf[STAND_ALONE_BUFFER_SIZE];
int len;
int ret = 0;
struct diag_ioctl_dump_param dump_param = {
.user_ptr_len = &len,
.user_buf_len = STAND_ALONE_BUFFER_SIZE,
.user_buf = variant_buf,
};
ret = diag_call_ioctl(IOCTL_DUMP_LOG_SA, (long)&dump_param);
if (ret == 0) {
do_extract(variant_buf, len);
}
}
static void do_pid(char *arg) {
int pid = 0;
int ret;
@@ -133,9 +150,9 @@ static void do_pid(char *arg) {
if (ret) {
printf("Get pid info err: %d\n", ret);
}
sleep(3); // after 3sec
sleep(3); // after 3sec
do_dump("");
do_dump_sa("");
}
static void do_tgid(char *arg) {
@@ -154,7 +171,7 @@ static void do_tgid(char *arg) {
}
sleep(3);
do_dump("");
do_dump_sa("");
}
int main(int argc, char *argv[]) {

View File

@@ -14,6 +14,7 @@
#define IOCTL_MAGIC_NUMBER 'k'
#define IOCTL_PID _IOWR(IOCTL_MAGIC_NUMBER, 2, int)
#define IOCTL_TGID _IOWR(IOCTL_MAGIC_NUMBER, 3, int)
#define IOCTL_DUMP_LOG_SA _IOWR(IOCTL_MAGIC_NUMBER, 4, int)
// dump type
#define VARIABLE_MONITOR_RECORD_TYPE 0x0
@@ -35,6 +36,7 @@
#define TIMER_MAX_WATCH_NUM (32) // A timer max watch number at once time
#define VARIABLE_MONITOR_BUFFER_SIZE 256 * 1024 * 1024 // 256MB
#define STAND_ALONE_BUFFER_SIZE 50 * 1024 * 1024 // 50 MB
#define DIAG_USER_STACK_SIZE (16 * 1024)