mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
cr: generalized format strings
This patch replaces the format specifier %ld with PRIx64 in the following places: * the format string argument of the functions scanf() and printf(), * in the macros GEN_SYSCTL_*_FUNC. We need explicit specification of the integer size there. Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
7997f673be
commit
3c16edc0bd
@@ -215,7 +215,7 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr,
|
|||||||
|
|
||||||
if (p->vma.end == vma->vma.end &&
|
if (p->vma.end == vma->vma.end &&
|
||||||
p->vma.start == vma->vma.start) {
|
p->vma.start == vma->vma.start) {
|
||||||
pr_info("COW 0x%016lx-0x%016lx 0x%016lx vma\n",
|
pr_info("COW 0x%016"PRIx64"-0x%016"PRIx64" 0x%016"PRIx64" vma\n",
|
||||||
vma->vma.start, vma->vma.end, vma->vma.pgoff);
|
vma->vma.start, vma->vma.end, vma->vma.pgoff);
|
||||||
paddr = (void *) vma_premmaped_start(&p->vma);
|
paddr = (void *) vma_premmaped_start(&p->vma);
|
||||||
break;
|
break;
|
||||||
@@ -226,7 +226,7 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr,
|
|||||||
*pvma = p;
|
*pvma = p;
|
||||||
|
|
||||||
if (paddr == NULL) {
|
if (paddr == NULL) {
|
||||||
pr_info("Map 0x%016lx-0x%016lx 0x%016lx vma\n",
|
pr_info("Map 0x%016"PRIx64"-0x%016"PRIx64" 0x%016"PRIx64" vma\n",
|
||||||
vma->vma.start, vma->vma.end, vma->vma.pgoff);
|
vma->vma.start, vma->vma.end, vma->vma.pgoff);
|
||||||
|
|
||||||
addr = mmap(tgt_addr, vma_entry_len(&vma->vma),
|
addr = mmap(tgt_addr, vma_entry_len(&vma->vma),
|
||||||
@@ -472,7 +472,7 @@ static int open_vmas(int pid)
|
|||||||
if (!(vma_entry_is(&vma->vma, VMA_AREA_REGULAR)))
|
if (!(vma_entry_is(&vma->vma, VMA_AREA_REGULAR)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pr_info("Opening 0x%016lx-0x%016lx 0x%016lx (%x) vma\n",
|
pr_info("Opening 0x%016"PRIx64"-0x%016"PRIx64" 0x%016"PRIx64" (%x) vma\n",
|
||||||
vma->vma.start, vma->vma.end,
|
vma->vma.start, vma->vma.end,
|
||||||
vma->vma.pgoff, vma->vma.status);
|
vma->vma.pgoff, vma->vma.status);
|
||||||
|
|
||||||
|
18
cr-show.c
18
cr-show.c
@@ -232,7 +232,7 @@ void show_pages(int fd_pages, struct cr_options *o)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_msg("0x%16lx ", e.va);
|
pr_msg("0x%16"PRIx64" ", e.va);
|
||||||
}
|
}
|
||||||
pr_msg("\n");
|
pr_msg("\n");
|
||||||
}
|
}
|
||||||
@@ -306,19 +306,19 @@ static inline char *task_state_str(int state)
|
|||||||
static void show_core_regs(UserX86RegsEntry *regs)
|
static void show_core_regs(UserX86RegsEntry *regs)
|
||||||
{
|
{
|
||||||
#define pr_regs4(s, n1, n2, n3, n4) \
|
#define pr_regs4(s, n1, n2, n3, n4) \
|
||||||
pr_msg("\t%8s: 0x%-16lx " \
|
pr_msg("\t%8s: 0x%-16"PRIx64" " \
|
||||||
"%8s: 0x%-16lx " \
|
"%8s: 0x%-16"PRIx64" " \
|
||||||
"%8s: 0x%-16lx " \
|
"%8s: 0x%-16"PRIx64" " \
|
||||||
"%8s: 0x%-16lx\n", \
|
"%8s: 0x%-16"PRIx64"\n", \
|
||||||
#n1, s->n1, \
|
#n1, s->n1, \
|
||||||
#n2, s->n2, \
|
#n2, s->n2, \
|
||||||
#n3, s->n3, \
|
#n3, s->n3, \
|
||||||
#n4, s->n4)
|
#n4, s->n4)
|
||||||
|
|
||||||
#define pr_regs3(s, n1, n2, n3) \
|
#define pr_regs3(s, n1, n2, n3) \
|
||||||
pr_msg("\t%8s: 0x%-16lx " \
|
pr_msg("\t%8s: 0x%-16"PRIx64" " \
|
||||||
"%8s: 0x%-16lx " \
|
"%8s: 0x%-16"PRIx64" " \
|
||||||
"%8s: 0x%-16lx\n", \
|
"%8s: 0x%-16"PRIx64"\n", \
|
||||||
#n1, s->n1, \
|
#n1, s->n1, \
|
||||||
#n2, s->n2, \
|
#n2, s->n2, \
|
||||||
#n3, s->n3)
|
#n3, s->n3)
|
||||||
@@ -341,7 +341,7 @@ void show_thread_info(ThreadInfoX86 *thread_info)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
pr_msg("\t---[ Thread info ]---\n");
|
pr_msg("\t---[ Thread info ]---\n");
|
||||||
pr_msg("\tclear_tid_addr: 0x%lx\n", thread_info->clear_tid_addr);
|
pr_msg("\tclear_tid_addr: 0x%"PRIx64"\n", thread_info->clear_tid_addr);
|
||||||
pr_msg("\n");
|
pr_msg("\n");
|
||||||
|
|
||||||
show_core_regs(thread_info->gpregs);
|
show_core_regs(thread_info->gpregs);
|
||||||
|
@@ -40,7 +40,7 @@ int is_eventfd_link(int lfd)
|
|||||||
|
|
||||||
static void pr_info_eventfd(char *action, EventfdFileEntry *efe)
|
static void pr_info_eventfd(char *action, EventfdFileEntry *efe)
|
||||||
{
|
{
|
||||||
pr_info("%s: id %#08x flags %#04x counter %#016lx\n",
|
pr_info("%s: id %#08x flags %#04x counter %#016"PRIx64"\n",
|
||||||
action, efe->id, efe->flags, efe->counter);
|
action, efe->id, efe->flags, efe->counter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ int is_eventpoll_link(int lfd)
|
|||||||
|
|
||||||
static void pr_info_eventpoll_tfd(char *action, EventpollTfdEntry *e)
|
static void pr_info_eventpoll_tfd(char *action, EventpollTfdEntry *e)
|
||||||
{
|
{
|
||||||
pr_info("%seventpoll-tfd: id %#08x tfd %#08x events %#08x data %#016lx\n",
|
pr_info("%seventpoll-tfd: id %#08x tfd %#08x events %#08x data %#016"PRIx64"\n",
|
||||||
action, e->id, e->tfd, e->events, e->data);
|
action, e->id, e->tfd, e->events, e->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -288,7 +288,7 @@ static int dump_ghost_remap(char *path, const struct stat *st, int lfd, u32 id)
|
|||||||
pr_info("Dumping ghost file for fd %d id %#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) {
|
if (st->st_size > MAX_GHOST_FILE_SIZE) {
|
||||||
pr_err("Can't dump ghost file %s of %lu size\n",
|
pr_err("Can't dump ghost file %s of %"PRIu64" size\n",
|
||||||
path, st->st_size);
|
path, st->st_size);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -102,9 +102,9 @@ static int dump_inotify_entry(union fdinfo_entries *e, void *arg)
|
|||||||
InotifyWdEntry *we = &e->ify;
|
InotifyWdEntry *we = &e->ify;
|
||||||
|
|
||||||
we->id = *(u32 *)arg;
|
we->id = *(u32 *)arg;
|
||||||
pr_info("wd: wd 0x%08x s_dev 0x%08x i_ino 0x%16lx mask 0x%08x\n",
|
pr_info("wd: wd 0x%08x s_dev 0x%08x i_ino 0x%16"PRIx64" mask 0x%08x\n",
|
||||||
we->wd, we->s_dev, we->i_ino, we->mask);
|
we->wd, we->s_dev, we->i_ino, we->mask);
|
||||||
pr_info("\t[fhandle] bytes 0x%08x type 0x%08x __handle 0x%016lx:0x%016lx\n",
|
pr_info("\t[fhandle] bytes 0x%08x type 0x%08x __handle 0x%016"PRIx64":0x%016"PRIx64"\n",
|
||||||
we->f_handle->bytes, we->f_handle->type,
|
we->f_handle->bytes, we->f_handle->type,
|
||||||
we->f_handle->handle[0], we->f_handle->handle[1]);
|
we->f_handle->handle[0], we->f_handle->handle[1]);
|
||||||
return pb_write_one(fdset_fd(glob_fdset, CR_FD_INOTIFY_WD), we, PB_INOTIFY_WD);
|
return pb_write_one(fdset_fd(glob_fdset, CR_FD_INOTIFY_WD), we, PB_INOTIFY_WD);
|
||||||
@@ -146,10 +146,10 @@ static int dump_fanotify_entry(union fdinfo_entries *e, void *arg)
|
|||||||
|
|
||||||
BUG_ON(!fme->ie);
|
BUG_ON(!fme->ie);
|
||||||
|
|
||||||
pr_info("mark: s_dev 0x%08x i_ino 0x%016lx mask 0x%08x\n",
|
pr_info("mark: s_dev 0x%08x i_ino 0x%016"PRIx64" mask 0x%08x\n",
|
||||||
fme->s_dev, fme->ie->i_ino, fme->mask);
|
fme->s_dev, fme->ie->i_ino, fme->mask);
|
||||||
|
|
||||||
pr_info("\t[fhandle] bytes 0x%08x type 0x%08x __handle 0x%016lx:0x%016lx\n",
|
pr_info("\t[fhandle] bytes 0x%08x type 0x%08x __handle 0x%016"PRIx64":0x%016"PRIx64"\n",
|
||||||
fme->ie->f_handle->bytes, fme->ie->f_handle->type,
|
fme->ie->f_handle->bytes, fme->ie->f_handle->type,
|
||||||
fme->ie->f_handle->handle[0], fme->ie->f_handle->handle[1]);
|
fme->ie->f_handle->handle[0], fme->ie->f_handle->handle[1]);
|
||||||
}
|
}
|
||||||
|
4
ipc_ns.c
4
ipc_ns.c
@@ -156,7 +156,7 @@ static int dump_ipc_sem(int fd)
|
|||||||
|
|
||||||
static void pr_info_ipc_msg(int nr, const IpcMsg *msg)
|
static void pr_info_ipc_msg(int nr, const IpcMsg *msg)
|
||||||
{
|
{
|
||||||
print_on_level(LOG_INFO, " %-5d: type: %-20ld size: %-10d\n",
|
print_on_level(LOG_INFO, " %-5d: type: %-20"PRId64" size: %-10d\n",
|
||||||
nr++, msg->mtype, msg->msize);
|
nr++, msg->mtype, msg->msize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ static int dump_ipc_msg(int fd)
|
|||||||
static void pr_info_ipc_shm(const IpcShmEntry *shm)
|
static void pr_info_ipc_shm(const IpcShmEntry *shm)
|
||||||
{
|
{
|
||||||
pr_ipc_desc_entry(LOG_INFO, shm->desc);
|
pr_ipc_desc_entry(LOG_INFO, shm->desc);
|
||||||
print_on_level(LOG_INFO, "size: %-10lu\n", shm->size);
|
print_on_level(LOG_INFO, "size: %-10"PRIu64"\n", shm->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ipc_sysctl_req(IpcVarEntry *e, int op)
|
static int ipc_sysctl_req(IpcVarEntry *e, int op)
|
||||||
|
@@ -546,7 +546,7 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a
|
|||||||
goto out_fini;
|
goto out_fini;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("vma %lx-%lx dumped: %lu pages %lu skipped %lu total\n",
|
pr_info("vma %"PRIx64"-%"PRIx64" dumped: %lu pages %lu skipped %lu total\n",
|
||||||
vma_area->vma.start, vma_area->vma.end,
|
vma_area->vma.start, vma_area->vma.end,
|
||||||
parasite_dumppages->nrpages_dumped,
|
parasite_dumppages->nrpages_dumped,
|
||||||
parasite_dumppages->nrpages_skipped,
|
parasite_dumppages->nrpages_skipped,
|
||||||
|
@@ -259,7 +259,7 @@ static u64 restore_mapping(const VmaEntry *vma_entry)
|
|||||||
if (vma_entry->fd == -1 || !(vma_entry->flags & MAP_SHARED))
|
if (vma_entry->fd == -1 || !(vma_entry->flags & MAP_SHARED))
|
||||||
prot |= PROT_WRITE;
|
prot |= PROT_WRITE;
|
||||||
|
|
||||||
pr_debug("\tmmap(%lx -> %lx, %x %x %d\n",
|
pr_debug("\tmmap(%"PRIx64" -> %"PRIx64", %x %x %d\n",
|
||||||
vma_entry->start, vma_entry->end,
|
vma_entry->start, vma_entry->end,
|
||||||
prot, flags, (int)vma_entry->fd);
|
prot, flags, (int)vma_entry->fd);
|
||||||
/*
|
/*
|
||||||
@@ -415,7 +415,7 @@ long __export_restore_task(struct task_restore_core_args *args)
|
|||||||
if (!vma_entry_is(vma_entry, VMA_AREA_REGULAR))
|
if (!vma_entry_is(vma_entry, VMA_AREA_REGULAR))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pr_debug("Examine %lx-%lx\n", vma_entry->start, vma_entry->end);
|
pr_debug("Examine %"PRIx64"-%"PRIx64"\n", vma_entry->start, vma_entry->end);
|
||||||
|
|
||||||
if (addr < args->premmapped_addr) {
|
if (addr < args->premmapped_addr) {
|
||||||
if (vma_entry->end >= args->premmapped_addr)
|
if (vma_entry->end >= args->premmapped_addr)
|
||||||
@@ -497,7 +497,7 @@ long __export_restore_task(struct task_restore_core_args *args)
|
|||||||
va = restore_mapping(vma_entry);
|
va = restore_mapping(vma_entry);
|
||||||
|
|
||||||
if (va != vma_entry->start) {
|
if (va != vma_entry->start) {
|
||||||
pr_err("Can't restore %lx mapping with %lx\n", vma_entry->start, va);
|
pr_err("Can't restore %"PRIx64" mapping with %"PRIx64"\n", vma_entry->start, va);
|
||||||
goto core_restore_end;
|
goto core_restore_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -542,7 +542,7 @@ long __export_restore_task(struct task_restore_core_args *args)
|
|||||||
vma_entry_len(vma_entry),
|
vma_entry_len(vma_entry),
|
||||||
i);
|
i);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("madvise(%lx, %ld, %ld) "
|
pr_err("madvise(%"PRIx64", %"PRIu64", %ld) "
|
||||||
"failed with %ld\n",
|
"failed with %ld\n",
|
||||||
vma_entry->start,
|
vma_entry->start,
|
||||||
vma_entry_len(vma_entry),
|
vma_entry_len(vma_entry),
|
||||||
|
16
proc_parse.c
16
proc_parse.c
@@ -162,7 +162,7 @@ static int is_anon_shmem_map(dev_t dev)
|
|||||||
munmap(map, PAGE_SIZE);
|
munmap(map, PAGE_SIZE);
|
||||||
|
|
||||||
shmem_dev = buf.st_dev;
|
shmem_dev = buf.st_dev;
|
||||||
pr_info("Found anon-shmem piggie at %lx\n", shmem_dev);
|
pr_info("Found anon-shmem piggie at %"PRIx64"\n", shmem_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
return shmem_dev == dev;
|
return shmem_dev == dev;
|
||||||
@@ -197,7 +197,7 @@ int parse_smaps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
|
|||||||
if (!is_vma_range_fmt(buf)) {
|
if (!is_vma_range_fmt(buf)) {
|
||||||
if (!strncmp(buf, "Nonlinear", 9)) {
|
if (!strncmp(buf, "Nonlinear", 9)) {
|
||||||
BUG_ON(!vma_area);
|
BUG_ON(!vma_area);
|
||||||
pr_err("Nonlinear mapping found %016lx-%016lx\n",
|
pr_err("Nonlinear mapping found %016"PRIx64"-%016"PRIx64"\n",
|
||||||
vma_area->vma.start, vma_area->vma.end);
|
vma_area->vma.start, vma_area->vma.end);
|
||||||
/*
|
/*
|
||||||
* VMA is already on list and will be
|
* VMA is already on list and will be
|
||||||
@@ -249,7 +249,7 @@ int parse_smaps(pid_t pid, struct list_head *vma_area_list, bool use_map_files)
|
|||||||
if (!S_ISSOCK(buf.st_mode))
|
if (!S_ISSOCK(buf.st_mode))
|
||||||
goto err_bogus_mapfile;
|
goto err_bogus_mapfile;
|
||||||
|
|
||||||
pr_info("Found socket %lu mapping @%lx\n", buf.st_ino, start);
|
pr_info("Found socket %"PRIu64" mapping @%lx\n", buf.st_ino, start);
|
||||||
vma_area->vma.status |= VMA_AREA_SOCKET | VMA_AREA_REGULAR;
|
vma_area->vma.status |= VMA_AREA_SOCKET | VMA_AREA_REGULAR;
|
||||||
vma_area->vm_socket_id = buf.st_ino;
|
vma_area->vm_socket_id = buf.st_ino;
|
||||||
} else if (errno != ENOENT)
|
} else if (errno != ENOENT)
|
||||||
@@ -358,7 +358,7 @@ err:
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
err_bogus_mapping:
|
err_bogus_mapping:
|
||||||
pr_err("Bogus mapping 0x%lx-0x%lx (flags: %#x vm_file_fd: %d)\n",
|
pr_err("Bogus mapping 0x%"PRIx64"-0x%"PRIx64" (flags: %#x vm_file_fd: %d)\n",
|
||||||
vma_area->vma.start, vma_area->vma.end,
|
vma_area->vma.start, vma_area->vma.end,
|
||||||
vma_area->vma.flags, vma_area->vm_file_fd);
|
vma_area->vma.flags, vma_area->vm_file_fd);
|
||||||
goto err;
|
goto err;
|
||||||
@@ -893,7 +893,7 @@ int parse_fdinfo(int fd, int type,
|
|||||||
|
|
||||||
if (type != FD_TYPES__EVENTFD)
|
if (type != FD_TYPES__EVENTFD)
|
||||||
goto parse_err;
|
goto parse_err;
|
||||||
ret = sscanf(str, "eventfd-count: %lx",
|
ret = sscanf(str, "eventfd-count: %"PRIx64,
|
||||||
&entry.efd.counter);
|
&entry.efd.counter);
|
||||||
if (ret != 1)
|
if (ret != 1)
|
||||||
goto parse_err;
|
goto parse_err;
|
||||||
@@ -909,7 +909,7 @@ int parse_fdinfo(int fd, int type,
|
|||||||
|
|
||||||
if (type != FD_TYPES__EVENTPOLL)
|
if (type != FD_TYPES__EVENTPOLL)
|
||||||
goto parse_err;
|
goto parse_err;
|
||||||
ret = sscanf(str, "tfd: %d events: %x data: %lx",
|
ret = sscanf(str, "tfd: %d events: %x data: %"PRIx64,
|
||||||
&entry.epl.tfd, &entry.epl.events, &entry.epl.data);
|
&entry.epl.tfd, &entry.epl.events, &entry.epl.data);
|
||||||
if (ret != 3)
|
if (ret != 3)
|
||||||
goto parse_err;
|
goto parse_err;
|
||||||
@@ -962,7 +962,7 @@ int parse_fdinfo(int fd, int type,
|
|||||||
entry.ffy.ie = &ie;
|
entry.ffy.ie = &ie;
|
||||||
|
|
||||||
ret = sscanf(str,
|
ret = sscanf(str,
|
||||||
"fanotify ino:%lx sdev:%x mflags:%x mask:%x ignored_mask:%x "
|
"fanotify ino:%"PRIx64" sdev:%x mflags:%x mask:%x ignored_mask:%x "
|
||||||
"fhandle-bytes:%x fhandle-type:%x f_handle: %n",
|
"fhandle-bytes:%x fhandle-type:%x f_handle: %n",
|
||||||
&ie.i_ino, &entry.ffy.s_dev,
|
&ie.i_ino, &entry.ffy.s_dev,
|
||||||
&entry.ffy.mflags, &entry.ffy.mask, &entry.ffy.ignored_mask,
|
&entry.ffy.mflags, &entry.ffy.mask, &entry.ffy.ignored_mask,
|
||||||
@@ -1020,7 +1020,7 @@ int parse_fdinfo(int fd, int type,
|
|||||||
if (type != FD_TYPES__INOTIFY)
|
if (type != FD_TYPES__INOTIFY)
|
||||||
goto parse_err;
|
goto parse_err;
|
||||||
ret = sscanf(str,
|
ret = sscanf(str,
|
||||||
"inotify wd:%x ino:%lx sdev:%x "
|
"inotify wd:%x ino:%"PRIx64" sdev:%x "
|
||||||
"mask:%x ignored_mask:%x "
|
"mask:%x ignored_mask:%x "
|
||||||
"fhandle-bytes:%x fhandle-type:%x "
|
"fhandle-bytes:%x fhandle-type:%x "
|
||||||
"f_handle: %n",
|
"f_handle: %n",
|
||||||
|
10
shmem.c
10
shmem.c
@@ -58,7 +58,7 @@ static int collect_shmem(int pid, VmaEntry *vi)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("Add new shmem 0x%lx (0x0160x%lx-0x0160x%lx)",
|
pr_info("Add new shmem 0x%"PRIx64" (0x0160x%"PRIx64"-0x0160x%"PRIx64")",
|
||||||
vi->shmid, vi->start, vi->end);
|
vi->shmid, vi->start, vi->end);
|
||||||
|
|
||||||
si = &rst_shmems->entries[nr_shmems];
|
si = &rst_shmems->entries[nr_shmems];
|
||||||
@@ -94,7 +94,7 @@ int prepare_shmem_pid(int pid)
|
|||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pr_info("vma 0x%lx 0x%lx\n", vi->start, vi->end);
|
pr_info("vma 0x%"PRIx64" 0x%"PRIx64"\n", vi->start, vi->end);
|
||||||
|
|
||||||
if (!vma_entry_is(vi, VMA_ANON_SHARED) ||
|
if (!vma_entry_is(vi, VMA_ANON_SHARED) ||
|
||||||
vma_entry_is(vi, VMA_AREA_SYSVIPC)) {
|
vma_entry_is(vi, VMA_AREA_SYSVIPC)) {
|
||||||
@@ -167,9 +167,9 @@ int get_shmem_fd(int pid, VmaEntry *vi)
|
|||||||
int f;
|
int f;
|
||||||
|
|
||||||
si = find_shmem(rst_shmems, vi->shmid);
|
si = find_shmem(rst_shmems, vi->shmid);
|
||||||
pr_info("Search for 0x%016lx shmem 0x%lx %p/%d\n", vi->start, vi->shmid, si, si ? si->pid : -1);
|
pr_info("Search for 0x%016"PRIx64" shmem 0x%"PRIx64" %p/%d\n", vi->start, vi->shmid, si, si ? si->pid : -1);
|
||||||
if (!si) {
|
if (!si) {
|
||||||
pr_err("Can't find my shmem 0x%016lx\n", vi->start);
|
pr_err("Can't find my shmem 0x%016"PRIx64"\n", vi->start);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ int get_shmem_fd(int pid, VmaEntry *vi)
|
|||||||
PROT_WRITE | PROT_READ,
|
PROT_WRITE | PROT_READ,
|
||||||
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
|
MAP_SHARED | MAP_ANONYMOUS, -1, 0);
|
||||||
if (addr == MAP_FAILED) {
|
if (addr == MAP_FAILED) {
|
||||||
pr_err("Can't mmap shmid=0x%lx size=%ld\n",
|
pr_err("Can't mmap shmid=0x%"PRIx64" size=%ld\n",
|
||||||
vi->shmid, si->size);
|
vi->shmid, si->size);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -228,7 +228,7 @@ int dump_socket_map(struct vma_area *vma)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("Dumping socket map %x -> %lx\n", sd->file_id, vma->vma.start);
|
pr_info("Dumping socket map %x -> %"PRIx64"\n", sd->file_id, vma->vma.start);
|
||||||
vma->vma.shmid = sd->file_id;
|
vma->vma.shmid = sd->file_id;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
6
sysctl.c
6
sysctl.c
@@ -134,14 +134,14 @@ GEN_SYSCTL_READ_FUNC(u32, strtoul);
|
|||||||
GEN_SYSCTL_READ_FUNC(u64, strtoull);
|
GEN_SYSCTL_READ_FUNC(u64, strtoull);
|
||||||
|
|
||||||
GEN_SYSCTL_WRITE_FUNC(u32, "%u ");
|
GEN_SYSCTL_WRITE_FUNC(u32, "%u ");
|
||||||
GEN_SYSCTL_WRITE_FUNC(u64, "%lu ");
|
GEN_SYSCTL_WRITE_FUNC(u64, "%"PRIu64" ");
|
||||||
|
|
||||||
GEN_SYSCTL_PRINT_FUNC(u32, "%u ");
|
GEN_SYSCTL_PRINT_FUNC(u32, "%u ");
|
||||||
GEN_SYSCTL_PRINT_FUNC(u64, "%lu ");
|
GEN_SYSCTL_PRINT_FUNC(u64, "%"PRIu64" ");
|
||||||
GEN_SYSCTL_PRINT_FUNC(char, "%c");
|
GEN_SYSCTL_PRINT_FUNC(char, "%c");
|
||||||
|
|
||||||
GEN_SYSCTL_SHOW_FUNC(u32, "%u ");
|
GEN_SYSCTL_SHOW_FUNC(u32, "%u ");
|
||||||
GEN_SYSCTL_SHOW_FUNC(u64, "%lu ");
|
GEN_SYSCTL_SHOW_FUNC(u64, "%"PRIu64" ");
|
||||||
GEN_SYSCTL_SHOW_FUNC(char, "%c");
|
GEN_SYSCTL_SHOW_FUNC(char, "%c");
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
5
util.c
5
util.c
@@ -87,13 +87,14 @@ static void vma_opt_str(const struct vma_area *v, char *opt)
|
|||||||
void pr_vma(unsigned int loglevel, const struct vma_area *vma_area)
|
void pr_vma(unsigned int loglevel, const struct vma_area *vma_area)
|
||||||
{
|
{
|
||||||
char opt[VMA_OPT_LEN];
|
char opt[VMA_OPT_LEN];
|
||||||
|
memset(opt, 0, VMA_OPT_LEN);
|
||||||
|
|
||||||
if (!vma_area)
|
if (!vma_area)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vma_opt_str(vma_area, opt);
|
vma_opt_str(vma_area, opt);
|
||||||
print_on_level(loglevel, "%#lx-%#lx (%liK) prot %#x flags %#x off %#lx "
|
print_on_level(loglevel, "%#"PRIx64"-%#"PRIx64" (%"PRIi64"K) prot %#x flags %#x off %#"PRIx64" "
|
||||||
"%s shmid: %#lx\n",
|
"%s shmid: %#"PRIx64"\n",
|
||||||
vma_area->vma.start, vma_area->vma.end,
|
vma_area->vma.start, vma_area->vma.end,
|
||||||
KBYTES(vma_area_len(vma_area)),
|
KBYTES(vma_area_len(vma_area)),
|
||||||
vma_area->vma.prot,
|
vma_area->vma.prot,
|
||||||
|
Reference in New Issue
Block a user