Print this page
10052 "dladm show-ether" should pick one kstat snapshot and stick with it
Reviewed by: Rob Johnston <rob.johnston@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gergo Doma <domag02@gmail.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
*** 25,34 ****
--- 25,38 ----
/*
* Copyright 2017 Joyent, Inc.
*/
+ /*
+ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#include <stdio.h>
#include <locale.h>
#include <stdarg.h>
#include <stdlib.h>
#include <fcntl.h>
*** 424,434 ****
flow_node->fc_visited = B_TRUE;
prev_stat = flow_node->fc_stat;
/* Query library for current stats */
! curr_stat = dladm_flow_stat_query(flowname);
if (curr_stat == NULL)
goto done;
/* current stats - prev iteration stats */
diff_stat = dladm_flow_stat_diff(curr_stat, prev_stat);
--- 428,438 ----
flow_node->fc_visited = B_TRUE;
prev_stat = flow_node->fc_stat;
/* Query library for current stats */
! curr_stat = dladm_flow_stat_query(handle, flowname);
if (curr_stat == NULL)
goto done;
/* current stats - prev iteration stats */
diff_stat = dladm_flow_stat_diff(curr_stat, prev_stat);
*** 489,499 ****
dump_one_flow_stats(dladm_handle_t handle, dladm_flow_attr_t *attr, void *arg)
{
char *flowname = attr->fa_flowname;
void *stat;
! stat = dladm_flow_stat_query_all(flowname);
if (stat == NULL)
goto done;
print_all_stats(stat);
dladm_flow_stat_query_all_free(stat);
--- 493,503 ----
dump_one_flow_stats(dladm_handle_t handle, dladm_flow_attr_t *attr, void *arg)
{
char *flowname = attr->fa_flowname;
void *stat;
! stat = dladm_flow_stat_query_all(handle, flowname);
if (stat == NULL)
goto done;
print_all_stats(stat);
dladm_flow_stat_query_all_free(stat);