summaryrefslogtreecommitdiff
path: root/source/ucli
diff options
context:
space:
mode:
Diffstat (limited to 'source/ucli')
-rw-r--r--source/ucli/ucli.cc23
-rw-r--r--source/ucli/ucli.h2
2 files changed, 22 insertions, 3 deletions
diff --git a/source/ucli/ucli.cc b/source/ucli/ucli.cc
index d967d67..8b8460f 100644
--- a/source/ucli/ucli.cc
+++ b/source/ucli/ucli.cc
@@ -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[]) {
diff --git a/source/ucli/ucli.h b/source/ucli/ucli.h
index e5370f6..af62e91 100644
--- a/source/ucli/ucli.h
+++ b/source/ucli/ucli.h
@@ -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)