diff --git a/cr-dump.c b/cr-dump.c index 3db680d63..6c1cc0281 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -152,7 +152,7 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st) struct ghost_file_entry gfe; char lpath[32]; - pr_info("Dumping ghost file contents (id 0x%x)\n", id); + pr_info("Dumping ghost file contents (id %#x)\n", id); img = open_image(CR_FD_GHOST_FILE, O_DUMP, id); if (img < 0) @@ -189,7 +189,7 @@ static int dump_ghost_remap(char *path, const struct stat *st, int lfd, u32 id) struct ghost_file *gf; struct remap_file_path_entry rpe; - pr_info("Dumping ghost file for fd %d id 0x%x\n", lfd, id); + pr_info("Dumping ghost file for fd %d id %#x\n", lfd, id); if (st->st_size > MAX_GHOST_FILE_SIZE) { pr_err("Can't dump ghost file %s of %lu size\n", @@ -315,14 +315,14 @@ static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p) int ret = -1; int i = 0; - pr_info("Dumping pipe %d with id 0x%x pipe_id 0x%x\n", lfd, id, p->id); + pr_info("Dumping pipe %d with id %#x pipe_id %#x\n", lfd, id, p->id); fd_pipes = fdset_fd(glob_fdset, CR_FD_PIPES); if (p->flags & O_WRONLY) goto dump; - pr_info("Dumping data from pipe 0x%x fd %d\n", id, lfd); + pr_info("Dumping data from pipe %#x fd %d\n", id, lfd); for (i = 0; i < nr_pipes; i++) if (pipes[i] == p->id) @@ -380,7 +380,7 @@ dump: off &= PAGE_SIZE -1; if (off) pde.off = PAGE_SIZE - off; - pr_info("off 0x%lx 0x%x\n", off, pde.off); + pr_info("off 0x%lx %#x\n", off, pde.off); } if (write_img(fd_pipes, &pde)) @@ -502,7 +502,7 @@ static int fill_fd_params(pid_t pid, int fd, int lfd, char fd_flags, struct fd_p p->fd_flags = fd_flags; p->fown = (fown_t){ }; - pr_info("%d fdinfo %d: pos: 0x%16lx flags: %16o/0x%x\n", + pr_info("%d fdinfo %d: pos: 0x%16lx flags: %16o/%#x\n", pid, fd, p->pos, p->flags, (int)fd_flags); p->fown.signum = fcntl(lfd, F_GETSIG, 0); @@ -537,7 +537,7 @@ static int fill_fd_params(pid_t pid, int fd, int lfd, char fd_flags, struct fd_p static int dump_unsupp_fd(const struct fd_parms *p) { - pr_err("Can't dump file %d of that type [0x%x]\n", + pr_err("Can't dump file %d of that type [%#x]\n", p->fd, p->stat.st_mode); return -1; } @@ -669,7 +669,7 @@ static int dump_task_fs(pid_t pid, struct cr_fdset *fdset) close(fd); - pr_info("Dumping task cwd id 0x%x root id 0x%x\n", + pr_info("Dumping task cwd id %#x root id %#x\n", fe.cwd_id, fe.root_id); return write_img(fdset_fd(fdset, CR_FD_FS), &fe); diff --git a/cr-show.c b/cr-show.c index cf6471c5c..c0193f46f 100644 --- a/cr-show.c +++ b/cr-show.c @@ -83,7 +83,7 @@ void show_files(int fd_files, struct cr_options *o) if (ret <= 0) goto out; - pr_msg("type: %5s fd: %5d id: 0x%8x flags 0x%x", + pr_msg("type: %5s fd: %5d id: 0x%8x flags %#x", fdtype2s(e.type), e.fd, e.id, e.flags); pr_msg("\n"); @@ -95,7 +95,7 @@ out: void show_fown_cont(fown_t *fown) { - pr_msg("fown: uid: 0x%x euid: 0x%x signum: 0x%x pid_type: 0x%x pid: %u", + pr_msg("fown: uid: %#x euid: %#x signum: %#x pid_type: %#x pid: %u", fown->uid, fown->euid, fown->signum, fown->pid_type, fown->pid); } @@ -153,7 +153,7 @@ void show_remap_files(int fd, struct cr_options *o) if (ret <= 0) break; - pr_msg("0x%x -> 0x%x (%s)\n", rfe.orig_id, + pr_msg("%#x -> %#x (%s)\n", rfe.orig_id, (rfe.remap_id & ~REMAP_GHOST), remap_id_type(rfe.remap_id)); } @@ -167,7 +167,7 @@ void show_ghost_file(int fd, struct cr_options *o) pr_img_head(CR_FD_GHOST_FILE); if (read_img(fd, &gfe) > 0) - pr_msg("uid %u god %u mode 0x%x\n", gfe.uid, gfe.gid, gfe.mode); + pr_msg("uid %u god %u mode %#x\n", gfe.uid, gfe.gid, gfe.mode); pr_img_tail(CR_FD_GHOST_FILE); } @@ -225,8 +225,8 @@ void show_fs(int fd_fs, struct cr_options *o) pr_img_head(CR_FD_FS); if (read_img(fd_fs, &fe) > 0) { - pr_msg("CWD : 0x%x\n", fe.cwd_id); - pr_msg("ROOT: 0x%x\n", fe.root_id); + pr_msg("CWD : %#x\n", fe.cwd_id); + pr_msg("ROOT: %#x\n", fe.root_id); } pr_img_tail(CR_FD_FS); @@ -387,7 +387,7 @@ void show_creds(int fd, struct cr_options *o) show_cap("Prm", ce.cap_prm); show_cap("Bnd", ce.cap_bnd); - pr_msg("secbits: 0x%x\n", ce.secbits); + pr_msg("secbits: %#x\n", ce.secbits); out: pr_img_tail(CR_FD_CREDS); } @@ -511,7 +511,7 @@ static void show_core_rest(int fd_core) goto err; pr_msg("\n\t---[Task parameters]---\n"); - pr_msg("\tPersonality: 0x%x\n", tc.personality); + pr_msg("\tPersonality: %#x\n", tc.personality); pr_msg("\tCommand: %s\n", tc.comm); pr_msg("\tState: %d (%s)\n", (int)tc.task_state, @@ -535,10 +535,10 @@ static void show_core_ids(int fd) if (read_img(fd, &cie) < 0) goto err; - pr_msg("\tVM: 0x%x\n", cie.vm_id); - pr_msg("\tFS: 0x%x\n", cie.fs_id); - pr_msg("\tFILES: 0x%x\n", cie.files_id); - pr_msg("\tSIGHAND: 0x%x\n", cie.sighand_id); + pr_msg("\tVM: %#x\n", cie.vm_id); + pr_msg("\tFS: %#x\n", cie.fs_id); + pr_msg("\tFILES: %#x\n", cie.files_id); + pr_msg("\tSIGHAND: %#x\n", cie.sighand_id); err: return; } @@ -587,7 +587,7 @@ void show_mm(int fd_mm, struct cr_options *o) pr_msg("\tArg end: 0x%lx\n", mme.mm_arg_end); pr_msg("\tEnv start: 0x%lx\n", mme.mm_env_start); pr_msg("\tEnv end: 0x%lx\n", mme.mm_env_end); - pr_msg("\tExe file ID 0x%x\n", mme.exe_file_id); + pr_msg("\tExe file ID %#x\n", mme.exe_file_id); out: pr_img_tail(CR_FD_MM); } @@ -611,13 +611,13 @@ static int cr_parse_file(struct cr_options *opts) break; if (i == CR_FD_MAX) { - pr_err("Unknown magic 0x%x in %s\n", + pr_err("Unknown magic %#x in %s\n", magic, opts->show_dump_file); goto err; } if (!fdset_template[i].show) { - pr_err("No handler for 0x%x/%s\n", + pr_err("No handler for %#x/%s\n", magic, opts->show_dump_file); goto err; } diff --git a/files.c b/files.c index 34be21fb5..caecfbd2e 100644 --- a/files.c +++ b/files.c @@ -99,7 +99,7 @@ void show_saved_files(void) list_for_each_entry(fd, &file_descs[i], hash) { struct fdinfo_list_entry *le; - pr_info(" `- type %d ID 0x%x\n", fd->type, fd->id); + pr_info(" `- type %d ID %#x\n", fd->type, fd->id); list_for_each_entry(le, &fd->fd_info_head, desc_list) pr_info(" `- FD %d pid %d\n", le->fe.fd, le->pid); } @@ -192,7 +192,7 @@ static int open_remap_ghost(struct reg_file_info *rfi, * issues with cross-device links. */ - pr_info("Opening ghost file 0x%x for %s\n", rfe->remap_id, rfi->path); + pr_info("Opening ghost file %#x for %s\n", rfe->remap_id, rfi->path); gf = xmalloc(sizeof(*gf)); if (!gf) @@ -216,7 +216,7 @@ static int open_remap_ghost(struct reg_file_info *rfi, } if (fchown(gfd, gfe.uid, gfe.gid) < 0) { - pr_perror("Can't reset user/group on ghost 0x%x\n", rfe->remap_id); + pr_perror("Can't reset user/group on ghost %#x\n", rfe->remap_id); return -1; } @@ -253,21 +253,21 @@ static int collect_remaps(void) ret = -1; if (!(rfe.remap_id & REMAP_GHOST)) { - pr_err("Non ghost remap not supported @0x%x\n", + pr_err("Non ghost remap not supported @%#x\n", rfe.orig_id); break; } fdesc = find_file_desc_raw(FDINFO_REG, rfe.orig_id); if (fdesc == NULL) { - pr_err("Remap for non existing file 0x%x\n", + pr_err("Remap for non existing file %#x\n", rfe.orig_id); break; } rfe.remap_id &= ~REMAP_GHOST; rfi = container_of(fdesc, struct reg_file_info, d); - pr_info("Configuring remap 0x%x -> 0x%x\n", rfi->rfe.id, rfe.remap_id); + pr_info("Configuring remap %#x -> %#x\n", rfi->rfe.id, rfe.remap_id); ret = open_remap_ghost(rfi, &rfe); if (ret < 0) break; @@ -312,7 +312,7 @@ int collect_reg_files(void) rfi->remap_path = NULL; rfi->path[len] = '\0'; - pr_info("Collected [%s] ID 0x%x\n", rfi->path, rfi->rfe.id); + pr_info("Collected [%s] ID %#x\n", rfi->path, rfi->rfe.id); file_desc_add(&rfi->d, FDINFO_REG, rfi->rfe.id, ®_desc_ops); } @@ -428,7 +428,7 @@ int open_reg_by_id(u32 id) fd = find_file_desc_raw(FDINFO_REG, id); if (fd == NULL) { - pr_perror("Can't find regfile for 0x%x\n", id); + pr_perror("Can't find regfile for %#x\n", id); return -1; } diff --git a/kcmp-ids.c b/kcmp-ids.c index c8cd9ad65..028c774cf 100644 --- a/kcmp-ids.c +++ b/kcmp-ids.c @@ -59,7 +59,7 @@ static void show_subnode(struct rb_node *node, int self) { struct kid_entry *this = rb_entry(node, struct kid_entry, subtree_node); - pr_info("\t\t| 0x%x.0x%x %s\n", this->elem.genid, this->subid, + pr_info("\t\t| %#x.%#x %s\n", this->elem.genid, this->subid, self ? "(self)" : ""); if (node->rb_left) { pr_info("\t\t| left:\n"); @@ -83,7 +83,7 @@ static void show_node(struct rb_node *node) { struct kid_entry *this = rb_entry(node, struct kid_entry, node); - pr_info("\t0x%x.0x%x\n", this->elem.genid, this->subid); + pr_info("\t%#x.%#x\n", this->elem.genid, this->subid); if (node->rb_left) { pr_info("\tleft:\n"); show_node(node->rb_left); diff --git a/pipes.c b/pipes.c index 2ba118a4a..bb5860448 100644 --- a/pipes.c +++ b/pipes.c @@ -57,7 +57,7 @@ int collect_pipes(void) if (ret <= 0) break; - pr_info("Collected pipe entry ID 0x%x PIPE ID 0x%x\n", + pr_info("Collected pipe entry ID %#x PIPE ID %#x\n", pi->pe.id, pi->pe.pipe_id); file_desc_add(&pi->d, FDINFO_PIPE, pi->pe.id, @@ -85,7 +85,7 @@ static void show_saved_pipe_fds(struct pipe_info *pi) { struct fdinfo_list_entry *fle; - pr_info(" `- ID %p 0x%xpn", pi, pi->pe.id); + pr_info(" `- ID %p %#xpn", pi, pi->pe.id); list_for_each_entry(fle, &pi->d.fd_info_head, desc_list) pr_info(" `- FD %d pid %d\n", fle->fe.fd, fle->pid); } @@ -145,7 +145,7 @@ void mark_pipe_master() pi = list_first_entry(&pipes, struct pipe_info, list); list_move(&pi->list, &head); - pr_info(" `- PIPE ID 0x%x\n", pi->pe.pipe_id); + pr_info(" `- PIPE ID %#x\n", pi->pe.pipe_id); show_saved_pipe_fds(pi); fle = file_master(&pi->d); @@ -167,7 +167,7 @@ void mark_pipe_master() show_saved_pipe_fds(pic); } p->create = 1; - pr_info(" by 0x%x\n", p->pe.id); + pr_info(" by %#x\n", p->pe.id); } list_splice(&head, &pipes); @@ -227,12 +227,12 @@ static int restore_pipe_data(int pfd, struct pipe_info *pi) while (size != pi->bytes) { ret = splice(fd, NULL, pfd, NULL, pi->bytes - size, 0); if (ret < 0) { - pr_perror("0x%x: Error splicing data", pi->pe.id); + pr_perror("%#x: Error splicing data", pi->pe.id); goto err; } if (ret == 0) { - pr_err("0x%x: Wanted to restore %d bytes, but got %d\n", + pr_err("%#x: Wanted to restore %d bytes, but got %d\n", pi->pe.id, pi->bytes, size); ret = -1; goto err; @@ -256,7 +256,7 @@ static int open_pipe(struct file_desc *d) pi = container_of(d, struct pipe_info, d); - pr_info("\tCreating pipe pipe_id=0x%x id=0x%x\n", pi->pe.pipe_id, pi->pe.id); + pr_info("\tCreating pipe pipe_id=%#x id=%#x\n", pi->pe.pipe_id, pi->pe.id); if (!pi->create) return recv_pipe_fd(pi); diff --git a/proc_parse.c b/proc_parse.c index 68e98f2e2..2ba72d643 100644 --- a/proc_parse.c +++ b/proc_parse.c @@ -178,7 +178,7 @@ err: return ret; err_bogus_mapping: - pr_err("Bogus mapping 0x%lx-0x%lx (flags: 0x%x vm_file_fd: %d)\n", + pr_err("Bogus mapping 0x%lx-0x%lx (flags: %#x vm_file_fd: %d)\n", vma_area->vma.start, vma_area->vma.end, vma_area->vma.flags, vma_area->vm_file_fd); goto err; diff --git a/sockets.c b/sockets.c index eb951b095..3e2fbe261 100644 --- a/sockets.c +++ b/sockets.c @@ -312,7 +312,7 @@ static int dump_one_unix(const struct socket_desc *_sk, struct fd_parms *p, peer = (struct unix_sk_desc *)lookup_socket(ue.peer); if (!peer) { - pr_err("Unix socket 0x%x without peer 0x%x\n", + pr_err("Unix socket %#x without peer %#x\n", ue.id, ue.peer); goto err; } @@ -323,7 +323,7 @@ static int dump_one_unix(const struct socket_desc *_sk, struct fd_parms *p, */ if (peer->peer_ino != ue.id) { if (!peer->name) { - pr_err("Unix socket 0x%x with unreachable peer 0x%x (0x%x/%s)\n", + pr_err("Unix socket %#x with unreachable peer %#x (%#x/%s)\n", ue.id, ue.peer, peer->peer_ino, peer->name); goto err; } @@ -361,7 +361,7 @@ static int dump_one_unix(const struct socket_desc *_sk, struct fd_parms *p, ue.peer = e->sk_desc->sd.ino; - pr_debug("\t\tFixed inflight socket 0x%x peer 0x%x)\n", + pr_debug("\t\tFixed inflight socket %#x peer %#x)\n", ue.id, ue.peer); } @@ -525,7 +525,7 @@ static int unix_collect_one(const struct unix_diag_msg *m, (st.st_dev != kdev_to_odev(uv->udiag_vfs_dev))) { pr_info("unix: Dropping path for " "unlinked bound " - "sk 0x%x.0x%x real 0x%x.0x%x\n", + "sk %#x.%#x real %#x.%#x\n", (int)st.st_dev, (int)st.st_ino, (int)uv->udiag_vfs_dev, @@ -1067,7 +1067,7 @@ void show_inetsk(int fd, struct cr_options *o) } } - pr_msg("id 0x%x family %s type %s proto %s state %s %s:%d <-> %s:%d flags 0x%2x\n", + pr_msg("id %#x family %s type %s proto %s state %s %s:%d <-> %s:%d flags 0x%2x\n", ie.id, skfamily2s(ie.family), sktype2s(ie.type), skproto2s(ie.proto), skstate2s(ie.state), src_addr, ie.src_port, dst_addr, ie.dst_port, ie.flags); pr_msg("\t"), show_fown_cont(&ie.fown), pr_msg("\n"); @@ -1149,7 +1149,7 @@ int run_unix_connections(void) struct fdinfo_list_entry *fle; struct sockaddr_un addr; - pr_info("\tConnect 0x%x to 0x%x\n", ui->ue.id, peer->ue.id); + pr_info("\tConnect %#x to %#x\n", ui->ue.id, peer->ue.id); fle = file_master(&ui->d); @@ -1166,7 +1166,7 @@ try_again: goto try_again; /* FIXME use futex waiters */ } - pr_perror("Can't connect 0x%x socket", ui->ue.id); + pr_perror("Can't connect %#x socket", ui->ue.id); return -1; } @@ -1224,7 +1224,7 @@ static int open_unixsk_pair_master(struct unix_sk_info *ui) struct unix_sk_info *peer = ui->peer; struct fdinfo_list_entry *fle; - pr_info("Opening pair master (id 0x%x peer 0x%x)\n", + pr_info("Opening pair master (id %#x peer %#x)\n", ui->ue.id, ui->ue.peer); if (socketpair(PF_UNIX, ui->ue.type, 0, sk) < 0) { @@ -1275,7 +1275,7 @@ static int open_unixsk_pair_slave(struct unix_sk_info *ui) fle = file_master(&ui->d); - pr_info("Opening pair slave (id 0x%x peer 0x%x) on %d\n", + pr_info("Opening pair slave (id %#x peer %#x) on %d\n", ui->ue.id, ui->ue.peer, fle->fe.fd); sk = recv_fd(fle->fe.fd); @@ -1295,7 +1295,7 @@ static int open_unixsk_standalone(struct unix_sk_info *ui) { int sk; - pr_info("Opening standalone socket (id 0x%x peer 0x%x)\n", + pr_info("Opening standalone socket (id %#x peer %#x)\n", ui->ue.id, ui->ue.peer); sk = socket(PF_UNIX, ui->ue.type, 0); @@ -1311,13 +1311,13 @@ static int open_unixsk_standalone(struct unix_sk_info *ui) return -1; if (ui->ue.state == TCP_LISTEN) { - pr_info("\tPutting 0x%x into listen state\n", ui->ue.id); + pr_info("\tPutting %#x into listen state\n", ui->ue.id); if (listen(sk, ui->ue.backlog) < 0) { pr_perror("Can't make usk listen"); return -1; } } else if (ui->peer) { - pr_info("\tWill connect 0x%x to 0x%x later\n", ui->ue.id, ui->ue.peer); + pr_info("\tWill connect %#x to %#x later\n", ui->ue.id, ui->ue.peer); if (schedule_conn_job(ui)) return -1; } @@ -1433,7 +1433,7 @@ int resolve_unix_peers(void) peer = NULL; if (!peer) { - pr_err("FATAL: Peer 0x%x unresolved for 0x%x\n", + pr_err("FATAL: Peer %#x unresolved for %#x\n", ui->ue.peer, ui->ue.id); return -1; } @@ -1472,7 +1472,7 @@ int resolve_unix_peers(void) list_for_each_entry(ui, &unix_sockets, list) { struct fdinfo_list_entry *fle; - pr_info("\t0x%x -> 0x%x (0x%x) flags 0x%x\n", ui->ue.id, ui->ue.peer, + pr_info("\t%#x -> %#x (%#x) flags %#x\n", ui->ue.id, ui->ue.peer, ui->peer ? ui->peer->ue.id : 0, ui->flags); list_for_each_entry(fle, &ui->d.fd_info_head, desc_list) pr_info("\t\tfd %d in pid %d\n",