run_in_host
This commit is contained in:
@@ -2,10 +2,8 @@
|
||||
* various_monitor cli 命令行工具
|
||||
*/
|
||||
#include "ucli.h"
|
||||
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
static int task_info_extract(void *buf, unsigned int len, void *) {
|
||||
@@ -49,7 +47,10 @@ static int task_info_extract(void *buf, unsigned int len, void *) {
|
||||
tsk_info->task.state == 0 ? "R" : "D");
|
||||
|
||||
printk_task_brief(&tsk_info->task);
|
||||
diag_printf_raw_stack(tsk_info->task.tgid, tsk_info->task.container_tgid,
|
||||
// diag_printf_raw_stack(tsk_info->task.tgid, tsk_info->task.container_tgid,
|
||||
// tsk_info->task.comm, &tsk_info->raw_stack);
|
||||
printf("run_in_host: %d\n", run_in_host);
|
||||
diag_printf_raw_stack(run_in_host ? tsk_info->task.tgid : tsk_info->task.container_tgid, tsk_info->task.container_tgid,
|
||||
tsk_info->task.comm, &tsk_info->raw_stack);
|
||||
diag_printf_kern_stack(&tsk_info->kern_stack);
|
||||
|
||||
@@ -71,7 +72,7 @@ static void do_extract(char *buf, int len) {
|
||||
|
||||
static void do_dump(const char *arg) {
|
||||
//!todo
|
||||
static char variant_buf[512 * 1024 * 1024];
|
||||
static char variant_buf[256 * 1024 * 1024];
|
||||
int len;
|
||||
int ret = 0;
|
||||
|
||||
@@ -93,6 +94,8 @@ static void do_dump(const char *arg) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
run_in_host = check_in_host();
|
||||
|
||||
static const struct option long_options[] = {{"help", no_argument, 0, 0},
|
||||
{"report", no_argument, 0, 0},
|
||||
{"pid", required_argument, 0, 0},
|
||||
|
||||
Reference in New Issue
Block a user