Commit add21b75 authored by Pavel Emelyanov's avatar Pavel Emelyanov

show: Remove options args from ->show callback

This thing is global, we can address one explicitly.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent cd537bed
......@@ -53,7 +53,7 @@
static LIST_HEAD(pstree_list);
void show_files(int fd_files, struct cr_options *o)
void show_files(int fd_files)
{
pb_show_plain_pretty(fd_files, PB_FDINFO, "2:%#o 4:%d");
}
......@@ -65,17 +65,17 @@ void show_fown_cont(void *p)
fown->uid, fown->euid, fown->signum, fown->pid_type, fown->pid);
}
void show_reg_files(int fd_reg_files, struct cr_options *o)
void show_reg_files(int fd_reg_files)
{
pb_show_plain(fd_reg_files, PB_REG_FILES);
}
void show_remap_files(int fd, struct cr_options *o)
void show_remap_files(int fd)
{
pb_show_plain(fd, PB_REMAP_FPATH);
}
void show_ghost_file(int fd, struct cr_options *o)
void show_ghost_file(int fd)
{
pb_show_vertical(fd, PB_GHOST_FILE);
}
......@@ -86,52 +86,52 @@ static void pipe_data_handler(int fd, void *obj)
print_image_data(fd, e->bytes, opts.show_pages_content);
}
void show_pipes_data(int fd, struct cr_options *o)
void show_pipes_data(int fd)
{
pb_show_plain_payload(fd, PB_PIPES_DATA, pipe_data_handler);
}
void show_pipes(int fd_pipes, struct cr_options *o)
void show_pipes(int fd_pipes)
{
pb_show_plain(fd_pipes, PB_PIPES);
}
void show_fifo_data(int fd, struct cr_options *o)
void show_fifo_data(int fd)
{
show_pipes_data(fd, o);
show_pipes_data(fd);
}
void show_fifo(int fd, struct cr_options *o)
void show_fifo(int fd)
{
pb_show_plain(fd, PB_FIFO);
}
void show_tty(int fd, struct cr_options *o)
void show_tty(int fd)
{
pb_show_plain(fd, PB_TTY);
}
void show_tty_info(int fd, struct cr_options *o)
void show_tty_info(int fd)
{
pb_show_plain(fd, PB_TTY_INFO);
}
void show_file_locks(int fd, struct cr_options *o)
void show_file_locks(int fd)
{
pb_show_plain(fd, PB_FILE_LOCK);
}
void show_fs(int fd_fs, struct cr_options *o)
void show_fs(int fd_fs)
{
pb_show_vertical(fd_fs, PB_FS);
}
void show_vmas(int fd_vma, struct cr_options *o)
void show_vmas(int fd_vma)
{
pb_show_plain(fd_vma, PB_VMAS);
}
void show_rlimit(int fd, struct cr_options *o)
void show_rlimit(int fd)
{
pb_show_plain(fd, PB_RLIMIT);
}
......@@ -212,7 +212,7 @@ void print_image_data(int fd, unsigned int length, int show)
xfree(data);
}
void show_pagemap(int fd, struct cr_options *o)
void show_pagemap(int fd)
{
PagemapHead *h;
......@@ -223,7 +223,7 @@ void show_pagemap(int fd, struct cr_options *o)
return pb_show_plain_pretty(fd, PB_PAGEMAP, "2:%u");
}
void show_siginfo(int fd, struct cr_options *o)
void show_siginfo(int fd)
{
int ret;
......@@ -245,17 +245,17 @@ void show_siginfo(int fd, struct cr_options *o)
pr_img_tail(CR_FD_SIGNAL);
}
void show_sigacts(int fd_sigacts, struct cr_options *o)
void show_sigacts(int fd_sigacts)
{
pb_show_plain(fd_sigacts, PB_SIGACT);
}
void show_itimers(int fd, struct cr_options *o)
void show_itimers(int fd)
{
pb_show_plain_pretty(fd, PB_ITIMERS, "1:%Lu 2:%Lu 3:%Lu 4:%Lu");
}
void show_creds(int fd, struct cr_options *o)
void show_creds(int fd)
{
pb_show_vertical(fd, PB_CREDS);
}
......@@ -300,7 +300,7 @@ void show_collect_pstree(int fd, int collect)
"1:%d 2:%d 3:%d 4:%d 5:%d");
}
void show_pstree(int fd, struct cr_options *o)
void show_pstree(int fd)
{
show_collect_pstree(fd, 0);
}
......@@ -361,17 +361,17 @@ void show_thread_info(ThreadInfoX86 *thread_info)
show_core_regs(thread_info->gpregs);
}
void show_core(int fd_core, struct cr_options *o)
void show_core(int fd_core)
{
pb_show_vertical(fd_core, PB_CORE);
}
void show_ids(int fd_ids, struct cr_options *o)
void show_ids(int fd_ids)
{
pb_show_vertical(fd_ids, PB_IDS);
}
void show_mm(int fd_mm, struct cr_options *o)
void show_mm(int fd_mm)
{
pb_show_vertical(fd_mm, PB_MM);
}
......@@ -427,7 +427,7 @@ static int cr_parse_file(struct cr_options *opts)
goto err;
}
fdset_template[i].show(fd, opts);
fdset_template[i].show(fd);
ret = 0;
err:
close_safe(&fd);
......@@ -447,7 +447,7 @@ static int cr_show_pstree_item(struct cr_options *opts, struct pstree_item *item
pr_msg("Task %d:\n", item->pid.virt);
pr_msg("----------------------------------------\n");
show_core(fdset_fd(cr_fdset, CR_FD_CORE), opts);
show_core(fdset_fd(cr_fdset, CR_FD_CORE));
if (item->nr_threads > 1) {
int fd_th;
......@@ -464,7 +464,7 @@ static int cr_show_pstree_item(struct cr_options *opts, struct pstree_item *item
pr_msg("Thread %d.%d:\n", item->pid.virt, item->threads[i].virt);
pr_msg("----------------------------------------\n");
show_core(fd_th, opts);
show_core(fd_th);
close_safe(&fd_th);
}
}
......@@ -477,7 +477,7 @@ static int cr_show_pstree_item(struct cr_options *opts, struct pstree_item *item
pr_msg("* ");
pr_msg(fdset_template[i].fmt, item->pid.virt);
pr_msg(":\n");
fdset_template[i].show(fdset_fd(cr_fdset, i), opts);
fdset_template[i].show(fdset_fd(cr_fdset, i));
}
if (pb_read_one(fdset_fd(cr_fdset, CR_FD_IDS), &ids, PB_IDS) > 0) {
......@@ -487,7 +487,7 @@ static int cr_show_pstree_item(struct cr_options *opts, struct pstree_item *item
pr_msg(fdset_template[CR_FD_FDINFO].fmt, ids->files_id);
pr_msg(":\n");
show_files(i, opts);
show_files(i);
close(i);
}
......@@ -548,7 +548,7 @@ static int cr_show_all(struct cr_options *opts)
if (fd < 0)
goto out;
show_sk_queues(fd, opts);
show_sk_queues(fd);
close(fd);
pid = list_first_entry(&pstree_list, struct pstree_item, sibling)->pid.virt;
......
......@@ -44,7 +44,7 @@ static void pr_info_eventfd(char *action, EventfdFileEntry *efe)
action, efe->id, efe->flags, efe->counter);
}
void show_eventfds(int fd, struct cr_options *o)
void show_eventfds(int fd)
{
pb_show_plain(fd, PB_EVENTFD);
}
......
......@@ -56,12 +56,12 @@ static void pr_info_eventpoll(char *action, EventpollFileEntry *e)
pr_info("%seventpoll: id %#08x flags %#04x\n", action, e->id, e->flags);
}
void show_eventpoll_tfd(int fd, struct cr_options *o)
void show_eventpoll_tfd(int fd)
{
pb_show_plain(fd, PB_EVENTPOLL_TFD);
}
void show_eventpoll(int fd, struct cr_options *o)
void show_eventpoll(int fd)
{
pb_show_plain(fd, PB_EVENTPOLL);
}
......
......@@ -77,22 +77,22 @@ int is_fanotify_link(int lfd)
return is_anon_link_type(lfd, "[fanotify]");
}
void show_inotify_wd(int fd_inotify_wd, struct cr_options *o)
void show_inotify_wd(int fd_inotify_wd)
{
pb_show_plain(fd_inotify_wd, PB_INOTIFY_WD);
}
void show_inotify(int fd_inotify, struct cr_options *o)
void show_inotify(int fd_inotify)
{
pb_show_plain(fd_inotify, PB_INOTIFY);
}
void show_fanotify_mark(int fd, struct cr_options *o)
void show_fanotify_mark(int fd)
{
pb_show_plain(fd, PB_FANOTIFY_MARK);
}
void show_fanotify(int fd, struct cr_options *o)
void show_fanotify(int fd)
{
pb_show_plain(fd, PB_FANOTIFY);
}
......
......@@ -92,7 +92,7 @@ void kill_inventory(void)
fdset_template[CR_FD_INVENTORY].fmt, 0);
}
static void show_inventory(int fd, struct cr_options *o)
static void show_inventory(int fd)
{
pb_show_vertical(fd, PB_INVENTORY);
}
......@@ -111,7 +111,7 @@ static void show_inventory(int fd, struct cr_options *o)
.show = _show, \
}
static void show_raw_image(int fd, struct cr_options *opt) {};
static void show_raw_image(int fd) {};
struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = {
FD_ENTRY(INVENTORY, "inventory", show_inventory),
......
......@@ -154,34 +154,34 @@ extern bool is_any_service_fd(int fd);
struct cr_fd_desc_tmpl {
const char *fmt; /* format for the name */
u32 magic; /* magic in the header */
void (*show)(int fd, struct cr_options *o);
void (*show)(int fd);
};
void show_files(int fd_files, struct cr_options *o);
void show_pagemap(int fd, struct cr_options *o);
void show_reg_files(int fd_reg_files, struct cr_options *o);
void show_core(int fd_core, struct cr_options *o);
void show_ids(int fd_ids, struct cr_options *o);
void show_mm(int fd_mm, struct cr_options *o);
void show_vmas(int fd_vma, struct cr_options *o);
void show_pipes(int fd_pipes, struct cr_options *o);
void show_pipes_data(int fd_pipes, struct cr_options *o);
void show_fifo(int fd, struct cr_options *o);
void show_fifo_data(int fd_pipes, struct cr_options *o);
void show_pstree(int fd_pstree, struct cr_options *o);
void show_sigacts(int fd_sigacts, struct cr_options *o);
void show_siginfo(int fd, struct cr_options *o);
void show_itimers(int fd, struct cr_options *o);
void show_creds(int fd, struct cr_options *o);
void show_fs(int fd, struct cr_options *o);
void show_remap_files(int fd, struct cr_options *o);
void show_ghost_file(int fd, struct cr_options *o);
void show_files(int fd);
void show_pagemap(int fd);
void show_reg_files(int fd);
void show_core(int fd);
void show_ids(int fd);
void show_mm(int fd);
void show_vmas(int fd);
void show_pipes(int fd);
void show_pipes_data(int fd);
void show_fifo(int fd);
void show_fifo_data(int fd);
void show_pstree(int fd);
void show_sigacts(int fd);
void show_siginfo(int fd);
void show_itimers(int fd);
void show_creds(int fd);
void show_fs(int fd);
void show_remap_files(int fd);
void show_ghost_file(int fd);
void show_fown_cont(void *p);
void show_eventfds(int fd, struct cr_options *o);
void show_tty(int fd, struct cr_options *o);
void show_tty_info(int fd, struct cr_options *o);
void show_file_locks(int fd, struct cr_options *o);
void show_rlimit(int fd, struct cr_options *o);
void show_eventfds(int fd);
void show_tty(int fd);
void show_tty_info(int fd);
void show_file_locks(int fd);
void show_rlimit(int fd);
int check_img_inventory(void);
int write_img_inventory(void);
......
......@@ -12,6 +12,6 @@
extern int is_eventfd_link(int lfd);
extern int dump_eventfd(struct fd_parms *p, int lfd, const int fdinfo);
extern int collect_eventfd(void);
extern void show_eventfds(int fd, struct cr_options *o);
extern void show_eventfds(int fd);
#endif /* __CR_EVENTFD_H__ */
......@@ -12,7 +12,7 @@
extern int is_eventpoll_link(int lfd);
extern int dump_eventpoll(struct fd_parms *p, int lfd, const int fdinfo);
extern int collect_eventpoll(void);
extern void show_eventpoll(int fd, struct cr_options *o);
extern void show_eventpoll_tfd(int fd, struct cr_options *o);
extern void show_eventpoll(int fd);
extern void show_eventpoll_tfd(int fd);
#endif /* __CR_EVENTPOLL_H__ */
......@@ -20,9 +20,9 @@ extern int is_fanotify_link(int lfd);
extern int dump_inotify(struct fd_parms *p, int lfd, const int fdinfo);
extern int dump_fanotify(struct fd_parms *p, int lfd, const int fdinfo);
extern int collect_inotify(void);
extern void show_inotify_wd(int fd_inotify_wd, struct cr_options *o);
extern void show_inotify(int fd_inotify, struct cr_options *o);
extern void show_fanotify_mark(int fd, struct cr_options *o);
extern void show_fanotify(int fd, struct cr_options *o);
extern void show_inotify_wd(int fd);
extern void show_inotify(int fd);
extern void show_fanotify_mark(int fd);
extern void show_fanotify(int fd);
#endif /* __CR_FSNOTIFY_H__ */
......@@ -4,10 +4,10 @@
#include "crtools.h"
struct cr_options;
extern void show_ipc_var(int fd, struct cr_options *);
extern void show_ipc_shm(int fd, struct cr_options *);
extern void show_ipc_msg(int fd, struct cr_options *);
extern void show_ipc_sem(int fd, struct cr_options *);
extern void show_ipc_var(int fd);
extern void show_ipc_shm(int fd);
extern void show_ipc_msg(int fd);
extern void show_ipc_sem(int fd);
extern int dump_ipc_ns(int ns_pid, const struct cr_fdset *fdset);
extern int prepare_ipc_ns(int pid);
......
......@@ -13,7 +13,7 @@ extern struct fstype *find_fstype_by_name(char *fst);
struct cr_fdset;
extern int dump_mnt_ns(int pid, struct cr_fdset *);
struct cr_options;
extern void show_mountpoints(int fd, struct cr_options *);
extern void show_mountpoints(int fd);
int prepare_mnt_ns(int pid);
extern int pivot_root(const char *new_root, const char *put_old);
......
......@@ -4,7 +4,7 @@
#include "list.h"
struct cr_options;
void show_netdevices(int fd, struct cr_options *);
void show_netdevices(int fd);
struct cr_fdset;
int dump_net_ns(int pid, struct cr_fdset *);
......
......@@ -6,7 +6,7 @@ struct fd_parms;
struct cr_options;
extern int is_signalfd_link(int lfd);
extern int dump_signalfd(struct fd_parms *p, int lfd, const int fdinfo);
extern void show_signalfd(int fd, struct cr_options *o);
extern void show_signalfd(int fd);
extern int collect_signalfd(void);
#endif /* __CR_SIGNALFD_H__ */
......@@ -68,7 +68,7 @@ int restore_one_tcp(int sk, struct inet_sk_info *si);
#define SK_EST_PARAM "tcp-established"
struct cr_options;
void show_tcp_stream(int fd, struct cr_options *);
void show_tcp_stream(int fd);
int check_tcp(void);
......
......@@ -12,7 +12,7 @@ struct vma_area;
int dump_one_packet_sk(struct fd_parms *p, int lfd, const int fdinfo);
int collect_packet_sockets(void);
void show_packetsk(int fd, struct cr_options *);
void show_packetsk(int fd);
int dump_socket_map(struct vma_area *vma);
int get_socket_fd(int pid, VmaEntry *vma);
......
......@@ -8,7 +8,7 @@
extern int read_sk_queues(void);
extern int dump_sk_queue(int sock_fd, int sock_id);
extern void show_sk_queues(int fd, struct cr_options *o);
extern void show_sk_queues(int fd);
extern int restore_sk_queue(int fd, unsigned int peer_id);
#endif /* __CR_SK_QUEUE_H__ */
......@@ -43,10 +43,10 @@ extern int resolve_unix_peers(void);
extern int collect_netlink_sockets(void);
extern void show_unixsk(int fd, struct cr_options *o);
extern void show_inetsk(int fd, struct cr_options *o);
extern void show_sk_queues(int fd, struct cr_options *o);
extern void show_netlinksk(int fd, struct cr_options *o);
extern void show_unixsk(int fd);
extern void show_inetsk(int fd);
extern void show_sk_queues(int fd);
extern void show_netlinksk(int fd);
extern char *skfamily2s(u32 f);
extern char *sktype2s(u32 t);
......
......@@ -5,7 +5,7 @@
int dump_uts_ns(int ns_pid, struct cr_fdset *fdset);
struct cr_options;
void show_utsns(int fd, struct cr_options *);
void show_utsns(int fd);
int prepare_utsns(int pid);
extern struct ns_desc uts_ns_desc;
......
......@@ -467,7 +467,7 @@ static void ipc_sem_handler(int fd, void *obj)
pr_msg_ipc_sem_array(e->nsems, values);
}
void show_ipc_sem(int fd, struct cr_options *o)
void show_ipc_sem(int fd)
{
pb_show_plain_payload(fd, PB_IPCNS_SEM, ipc_sem_handler);
}
......@@ -489,7 +489,7 @@ static void ipc_msg_handler(int fd, void *obj)
}
void show_ipc_msg(int fd, struct cr_options *o)
void show_ipc_msg(int fd)
{
pb_show_plain_payload(fd, PB_IPCNS_MSG_ENT, ipc_msg_handler);
}
......@@ -500,12 +500,12 @@ static void ipc_shm_handler(int fd, void *obj)
print_image_data(fd, round_up(e->size, sizeof(u32)), opts.show_pages_content);
}
void show_ipc_shm(int fd, struct cr_options *o)
void show_ipc_shm(int fd)
{
pb_show_plain_payload(fd, PB_IPCNS_SHM, ipc_shm_handler);
}
void show_ipc_var(int fd, struct cr_options *o)
void show_ipc_var(int fd)
{
pb_show_vertical(fd, PB_IPCNS_VAR);
}
......
......@@ -769,7 +769,7 @@ int prepare_mnt_ns(int ns_pid)
return ret;
}
void show_mountpoints(int fd, struct cr_options *o)
void show_mountpoints(int fd)
{
pb_show_plain(fd, PB_MOUNTPOINTS);
}
......
......@@ -306,7 +306,7 @@ int try_show_namespaces(int ns_pid, struct cr_options *o)
if (fd == -1)
continue;
fdset_template[i].show(fdset_fd(fdset, i), o);
fdset_template[i].show(fdset_fd(fdset, i));
}
pr_msg("---[ end of %d namespaces ]---\n", ns_pid);
close_cr_fdset(&fdset);
......
......@@ -18,7 +18,7 @@
static int ns_fd = -1;
void show_netdevices(int fd, struct cr_options *opt)
void show_netdevices(int fd)
{
pb_show_plain_pretty(fd, PB_NETDEV, "2:%d");
}
......
......@@ -31,7 +31,7 @@ struct signalfd_dump_arg {
bool dumped;
};
void show_signalfd(int fd, struct cr_options *o)
void show_signalfd(int fd)
{
pb_show_plain(fd, PB_SIGNALFD);
}
......
......@@ -626,7 +626,7 @@ int inet_connect(int sk, struct inet_sk_info *ii)
return 0;
}
void show_inetsk(int fd, struct cr_options *o)
void show_inetsk(int fd)
{
pb_show_plain_pretty(fd, PB_INETSK, "1:%#x 2:%#x 3:%d 4:%d 5:%d 6:%d 7:%d 8:%d 9:%2x 11:A 12:A");
}
......@@ -65,7 +65,7 @@ int netlink_receive_one(struct nlmsghdr *hdr, void *arg)
return sk_collect_one(m->ndiag_ino, PF_NETLINK, &sd->sd);
}
void show_netlinksk(int fd, struct cr_options *o)
void show_netlinksk(int fd)
{
pb_show_plain(fd, PB_NETLINKSK);
}
......
......@@ -42,7 +42,7 @@ struct packet_sock_desc {
#define NO_FANOUT ((unsigned int)-1)
void show_packetsk(int fd, struct cr_options *o)
void show_packetsk(int fd)
{
pb_show_plain_pretty(fd, PB_PACKETSK, "5:%d");
}
......
......@@ -176,7 +176,7 @@ static void sk_queue_data_handler(int fd, void *obj)
print_image_data(fd, e->length, opts.show_pages_content);
}
void show_sk_queues(int fd, struct cr_options *o)
void show_sk_queues(int fd)
{
pb_show_plain_payload(fd, PB_SK_QUEUES, sk_queue_data_handler);
}
......
......@@ -615,7 +615,7 @@ void rst_unlock_tcp_connections(void)
nf_unlock_connection_info(ii);
}
void show_tcp_stream(int fd, struct cr_options *opt)
void show_tcp_stream(int fd)
{
pb_show_plain_pretty(fd, PB_TCP_STREAM, "1:%u 2:%u 3:%u 4:%u");
}
......
......@@ -491,7 +491,7 @@ static struct unix_sk_info *find_unix_sk_by_ino(int ino)
return NULL;
}
void show_unixsk(int fd, struct cr_options *o)
void show_unixsk(int fd)
{
pb_show_plain_pretty(fd, PB_UNIXSK, "1:%#x 2:%#x 3:%d 4:%d 5:%d 6:%d 7:%d 8:%#x 11:S");
}
......
......@@ -65,7 +65,7 @@ out:
return ret;
}
void show_utsns(int fd, struct cr_options *o)
void show_utsns(int fd)
{
pb_show_vertical(fd, PB_UTSNS);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment