Revert r323935 as it broke the build
subr_witness.c:2577:4: error: use of undeclared identifier 'req' req->oldidx = 0; ^
This commit is contained in:
parent
55f1f05248
commit
4c087f8a83
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323951
@ -2539,18 +2539,31 @@ DB_SHOW_COMMAND(witness, db_witness_display)
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
sbuf_print_witness_badstacks(struct sbuf *sb)
|
||||
static int
|
||||
sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct witness_lock_order_data *data1, *data2, *tmp_data1, *tmp_data2;
|
||||
struct witness *tmp_w1, *tmp_w2, *w1, *w2;
|
||||
struct sbuf *sb;
|
||||
u_int w_rmatrix1, w_rmatrix2;
|
||||
int generation, i, j;
|
||||
int error, generation, i, j;
|
||||
|
||||
tmp_data1 = NULL;
|
||||
tmp_data2 = NULL;
|
||||
tmp_w1 = NULL;
|
||||
tmp_w2 = NULL;
|
||||
if (witness_watch < 1) {
|
||||
error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning));
|
||||
return (error);
|
||||
}
|
||||
if (witness_cold) {
|
||||
error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold));
|
||||
return (error);
|
||||
}
|
||||
error = 0;
|
||||
sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND);
|
||||
if (sb == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
/* Allocate and init temporary storage space. */
|
||||
tmp_w1 = malloc(sizeof(struct witness), M_TEMP, M_WAITOK | M_ZERO);
|
||||
@ -2670,28 +2683,6 @@ sbuf_print_witness_badstacks(struct sbuf *sb)
|
||||
free(tmp_data2, M_TEMP);
|
||||
free(tmp_w1, M_TEMP);
|
||||
free(tmp_w2, M_TEMP);
|
||||
}
|
||||
|
||||
static int
|
||||
sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct sbuf *sb;
|
||||
int error;
|
||||
|
||||
if (witness_watch < 1) {
|
||||
error = SYSCTL_OUT(req, w_notrunning, sizeof(w_notrunning));
|
||||
return (error);
|
||||
}
|
||||
if (witness_cold) {
|
||||
error = SYSCTL_OUT(req, w_stillcold, sizeof(w_stillcold));
|
||||
return (error);
|
||||
}
|
||||
error = 0;
|
||||
sb = sbuf_new(NULL, NULL, badstack_sbuf_size, SBUF_AUTOEXTEND);
|
||||
if (sb == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
sbuf_print_witness_badstacks(sb);
|
||||
|
||||
sbuf_finish(sb);
|
||||
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
|
||||
@ -2700,26 +2691,6 @@ sysctl_debug_witness_badstacks(SYSCTL_HANDLER_ARGS)
|
||||
return (error);
|
||||
}
|
||||
|
||||
#ifdef DDB
|
||||
static int
|
||||
sbuf_db_printf_drain(void *arg __unused, const char *data, int len)
|
||||
{
|
||||
|
||||
return (db_printf("%.*s", len, data));
|
||||
}
|
||||
|
||||
DB_SHOW_COMMAND(badstacks, db_witness_badstacks)
|
||||
{
|
||||
struct sbuf sb;
|
||||
char buffer[128];
|
||||
|
||||
sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN);
|
||||
sbuf_set_drain(&sb, sbuf_db_printf_drain, NULL);
|
||||
sbuf_print_witness_badstacks(&sb);
|
||||
sbuf_finish(&sb);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
sysctl_debug_witness_channel(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user