char pid_str[11], tid_str[11], sig_str[11];
char *prstatus_fd_str = NULL;
+ char tid_comm_str[KERNEL_DEFINED_TASK_COMM_LEN + 1] = { 0, };
+
+ (void)read_proc_file(cinfo->tid_info, "comm", tid_comm_str, sizeof(tid_comm_str), filter_drop_trailing_whitespace);
if (asprintf(&prstatus_fd_str, "%d", cinfo->prstatus_fd) == -1) {
_E("Unable to allocate memory: %m");
"--reportpath", cinfo->result_path,
"--prstatus_fd", prstatus_fd_str,
"--signal", sig_str,
+ "--tid-comm", tid_comm_str,
NULL };
spawn(av, NULL, NULL, NULL, NULL);
char *report_path;
char *appid;
char *pkgid;
+ char *tid_comm;
};
static int _get_important_registers(int fd, struct RegInfo **reg_info)
g_variant_builder_close(&md_builder);
}
+ if (notify_params->tid_comm) {
+ g_variant_builder_open(&md_builder, G_VARIANT_TYPE("{sv}"));
+ g_variant_builder_add(&md_builder, "s", "sys.tid.comm");
+ g_variant_builder_add(&md_builder, "v", g_variant_new_string(notify_params->tid_comm));
+ g_variant_builder_close(&md_builder);
+ }
+
struct RegInfo *reg_info;
int regs_count = _get_important_registers(notify_params->prstatus_fd, ®_info);
FLAG_REPORTPATH,
FLAG_PRSTATUS_FD,
FLAG_SIGNAL,
+ FLAG_TID_COMM,
};
static const struct option options[] = {
{ .name = "cmdline", .has_arg = required_argument, .flag = NULL, .val = FLAG_CMDLINE },
{ .name = "reportpath", .has_arg = required_argument, .flag = NULL, .val = FLAG_REPORTPATH },
{ .name = "prstatus_fd", .has_arg = required_argument, .flag = NULL, .val = FLAG_PRSTATUS_FD },
{ .name = "signal", .has_arg = required_argument, .flag = NULL, .val = FLAG_SIGNAL },
+ { .name = "tid-comm", .has_arg = required_argument, .flag = NULL, .val = FLAG_TID_COMM },
{ NULL },
};
params->prstatus_fd = atoi(optarg);
else if (FLAG_SIGNAL == val)
params->signal = atoi(optarg);
+ else if (FLAG_TID_COMM == val)
+ params->tid_comm = optarg;
} while (val != -1);
return params->cmd_name && params->cmd_path && params->appid && params->pkgid && params->prstatus_fd > 0;