Project

General

Profile

Bug #3623

kstat must accept partial stat specification

Added by Heinz Gies over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
cmd - userland programs
Start date:
2013-03-12
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
kstat regression
Gerrit CR:

Description

it seems that with the new rewrite kstat requires a tailing colon (:) to it's statistic path which was not the case prior to this change and could break existing scripts.

In my case the call:

kstat -p zfs:0:arcstats

failed and had to be replaced with

kstat -p zfs:0:arcstats:

Cheers

History

#1

Updated by Rich Lowe over 7 years ago

  • Priority changed from Normal to High
  • Tags changed from needs-triage kstat regression to kstat regression
#2

Updated by Rich Lowe over 7 years ago

  • Assignee set to Rich Lowe

the new kstat does this explicitly, for some reason

diff --git a/usr/src/cmd/stat/kstat/kstat.c b/usr/src/cmd/stat/kstat/kstat.c
index 2165101..46e8dc5 100644
--- a/usr/src/cmd/stat/kstat/kstat.c
+++ b/usr/src/cmd/stat/kstat/kstat.c
@@ -255,12 +255,6 @@ main(int argc, char **argv)
                 }
             }

-            if (m < 4) {
-                free(uselector);
-                usage();
-                exit(2);
-            }
-
             uselflg = B_TRUE;
             list_insert_tail(&selector_list, uselector);
         } else {

Seems like all that's really necessary to stop it.

#3

Updated by Yuri Pankov over 7 years ago

Usage should be updated as well to show that all fields are optional:

kstat [ -Cjlpq ] [ -T d|u ] [ -c class ]
      [module[:instance[:name[:statistic]]]]...
      [interval [count]]

#4

Updated by Rich Lowe over 7 years ago

  • Subject changed from kstat c-rewrite regression to kstat must accept partial stat specification
#5

Updated by Rich Lowe over 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Resolved in 617413d

Also available in: Atom PDF