-/* $Id: engine.c,v 1.21 2017/04/05 15:57:11 deraadt Exp $ */
+/* $Id: engine.c,v 1.22 2018/02/08 07:00:33 martijn Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
*
/* ordering */
+int
+foreach_order(void (*callback)(order_type *))
+{
+ order_type *o;
+
+ if (curr_view == NULL || curr_view->mgr == NULL ||
+ curr_view->mgr->order_list == NULL)
+ return -1;
+ o = curr_view->mgr->order_list;
+ do {
+ callback(o++);
+ } while (o->name != NULL);
+ return 0;
+}
+
void
set_order(const char *opt)
{
-/* $Id: engine.h,v 1.8 2013/09/07 11:43:49 reyk Exp $ */
+/* $Id: engine.h,v 1.9 2018/02/08 07:00:33 martijn Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar <canacar@openbsd.org>
*
void next_view(void);
void prev_view(void);
+int foreach_order(void (*callback)(order_type *));
void set_order(const char *opt);
void next_order(void);
-/* $Id: main.c,v 1.66 2016/10/13 11:22:46 otto Exp $ */
+/* $Id: main.c,v 1.67 2018/02/08 07:00:33 martijn Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
message_set(tmp_buf);
}
+void
+add_order_tb(order_type *o)
+{
+ if (curr_view->mgr->order_curr == o)
+ tbprintf("[%s%s(%c)] ", o->name,
+ o->func != NULL && sortdir == -1 ? "^" : "",
+ (char) o->hotkey);
+ else
+ tbprintf("%s(%c) ", o->name, (char) o->hotkey);
+}
+
+void
+show_order(void)
+{
+ if (rawmode)
+ return;
+
+ tb_start();
+ if (foreach_order(add_order_tb) == -1) {
+ tbprintf("No orders available");
+ }
+ tb_end();
+ message_set(tmp_buf);
+}
+
void
cmd_compat(const char *buf)
{
cmd_delay(buf + 5);
return;
}
+ if (strncasecmp(buf, "order", 5) == 0) {
+ show_order();
+ need_update = 1;
+ return;
+ }
for (s = buf; *s && strchr("0123456789+-.eE", *s) != NULL; s++)
;
-/* $OpenBSD: pftop.c,v 1.40 2017/07/19 12:58:31 mikeb Exp $ */
+/* $OpenBSD: pftop.c,v 1.41 2018/02/08 07:00:33 martijn Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
/* Define view managers */
struct view_manager state_mgr = {
"States", select_states, read_states, sort_states, print_header,
- print_states, keyboard_callback, order_list, NULL
+ print_states, keyboard_callback, order_list, order_list
};
struct view_manager rule_mgr = {
-.\" $OpenBSD: systat.1,v 1.102 2017/06/15 03:47:07 dlg Exp $
+.\" $OpenBSD: systat.1,v 1.103 2018/02/08 07:00:33 martijn Exp $
.\" $NetBSD: systat.1,v 1.6 1996/05/10 23:16:39 thorpej Exp $
.\"
.\" Copyright (c) 1985, 1990, 1993
.\"
.\" @(#)systat.1 8.2 (Berkeley) 12/30/93
.\"
-.Dd $Mdocdate: June 15 2017 $
+.Dd $Mdocdate: February 8 2018 $
.Dt SYSTAT 1
.Os
.Sh NAME
.Bl -tag -width Fl
.It Ic help
Print the names of the available views on the command line.
+.It Ic order
+Print the names of the available orderings on the command line.
.It Ic quit
Quit
.Nm .
Display kernel
.Xr pool 9
per CPU cache statistics.
+Available orderings are:
+.Ic name ,
+.Ic request ,
+and
+.Ic releases .
.It Ic queues
Display statistics about the active queues,
similar to the output of