head	1.11;
access;
symbols
	netbsd-11-0-RC3:1.11
	netbsd-11-0-RC2:1.11
	netbsd-11-0-RC1:1.11
	perseant-exfatfs-base-20250801:1.11
	netbsd-11:1.11.0.2
	netbsd-11-base:1.11
	netbsd-10-1-RELEASE:1.10
	perseant-exfatfs-base-20240630:1.10
	perseant-exfatfs:1.10.0.58
	perseant-exfatfs-base:1.10
	netbsd-8-3-RELEASE:1.10
	netbsd-9-4-RELEASE:1.10
	netbsd-10-0-RELEASE:1.10
	netbsd-10-0-RC6:1.10
	netbsd-10-0-RC5:1.10
	netbsd-10-0-RC4:1.10
	netbsd-10-0-RC3:1.10
	netbsd-10-0-RC2:1.10
	netbsd-10-0-RC1:1.10
	netbsd-10:1.10.0.56
	netbsd-10-base:1.10
	netbsd-9-3-RELEASE:1.10
	cjep_sun2x-base1:1.10
	cjep_sun2x:1.10.0.54
	cjep_sun2x-base:1.10
	cjep_staticlib_x-base1:1.10
	netbsd-9-2-RELEASE:1.10
	cjep_staticlib_x:1.10.0.52
	cjep_staticlib_x-base:1.10
	netbsd-9-1-RELEASE:1.10
	phil-wifi-20200421:1.10
	phil-wifi-20200411:1.10
	is-mlppp:1.10.0.50
	is-mlppp-base:1.10
	phil-wifi-20200406:1.10
	netbsd-8-2-RELEASE:1.10
	netbsd-9-0-RELEASE:1.10
	netbsd-9-0-RC2:1.10
	netbsd-9-0-RC1:1.10
	phil-wifi-20191119:1.10
	netbsd-9:1.10.0.48
	netbsd-9-base:1.10
	phil-wifi-20190609:1.10
	netbsd-8-1-RELEASE:1.10
	netbsd-8-1-RC1:1.10
	pgoyette-compat-merge-20190127:1.10
	pgoyette-compat-20190127:1.10
	pgoyette-compat-20190118:1.10
	pgoyette-compat-1226:1.10
	pgoyette-compat-1126:1.10
	pgoyette-compat-1020:1.10
	pgoyette-compat-0930:1.10
	pgoyette-compat-0906:1.10
	netbsd-7-2-RELEASE:1.10
	pgoyette-compat-0728:1.10
	netbsd-8-0-RELEASE:1.10
	phil-wifi:1.10.0.46
	phil-wifi-base:1.10
	pgoyette-compat-0625:1.10
	netbsd-8-0-RC2:1.10
	pgoyette-compat-0521:1.10
	pgoyette-compat-0502:1.10
	pgoyette-compat-0422:1.10
	netbsd-8-0-RC1:1.10
	pgoyette-compat-0415:1.10
	pgoyette-compat-0407:1.10
	pgoyette-compat-0330:1.10
	pgoyette-compat-0322:1.10
	pgoyette-compat-0315:1.10
	netbsd-7-1-2-RELEASE:1.10
	pgoyette-compat:1.10.0.44
	pgoyette-compat-base:1.10
	netbsd-7-1-1-RELEASE:1.10
	matt-nb8-mediatek:1.10.0.42
	matt-nb8-mediatek-base:1.10
	perseant-stdc-iso10646:1.10.0.40
	perseant-stdc-iso10646-base:1.10
	netbsd-8:1.10.0.38
	netbsd-8-base:1.10
	prg-localcount2-base3:1.10
	prg-localcount2-base2:1.10
	prg-localcount2-base1:1.10
	prg-localcount2:1.10.0.36
	prg-localcount2-base:1.10
	pgoyette-localcount-20170426:1.10
	bouyer-socketcan-base1:1.10
	pgoyette-localcount-20170320:1.10
	netbsd-7-1:1.10.0.34
	netbsd-7-1-RELEASE:1.10
	netbsd-7-1-RC2:1.10
	netbsd-7-nhusb-base-20170116:1.10
	bouyer-socketcan:1.10.0.32
	bouyer-socketcan-base:1.10
	pgoyette-localcount-20170107:1.10
	netbsd-7-1-RC1:1.10
	pgoyette-localcount-20161104:1.10
	netbsd-7-0-2-RELEASE:1.10
	localcount-20160914:1.10
	netbsd-7-nhusb:1.10.0.30
	netbsd-7-nhusb-base:1.10
	pgoyette-localcount-20160806:1.10
	pgoyette-localcount-20160726:1.10
	pgoyette-localcount:1.10.0.28
	pgoyette-localcount-base:1.10
	netbsd-7-0-1-RELEASE:1.10
	netbsd-7-0:1.10.0.26
	netbsd-7-0-RELEASE:1.10
	netbsd-7-0-RC3:1.10
	netbsd-7-0-RC2:1.10
	netbsd-7-0-RC1:1.10
	netbsd-5-2-3-RELEASE:1.4
	netbsd-5-1-5-RELEASE:1.4
	netbsd-6-0-6-RELEASE:1.10
	netbsd-6-1-5-RELEASE:1.10
	netbsd-7:1.10.0.24
	netbsd-7-base:1.10
	yamt-pagecache-base9:1.10
	yamt-pagecache-tag8:1.10
	netbsd-6-1-4-RELEASE:1.10
	netbsd-6-0-5-RELEASE:1.10
	tls-earlyentropy:1.10.0.22
	tls-earlyentropy-base:1.10
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.10
	riastradh-drm2-base3:1.10
	netbsd-6-1-3-RELEASE:1.10
	netbsd-6-0-4-RELEASE:1.10
	netbsd-5-2-2-RELEASE:1.4
	netbsd-5-1-4-RELEASE:1.4
	netbsd-6-1-2-RELEASE:1.10
	netbsd-6-0-3-RELEASE:1.10
	netbsd-5-2-1-RELEASE:1.4
	netbsd-5-1-3-RELEASE:1.4
	netbsd-6-1-1-RELEASE:1.10
	riastradh-drm2-base2:1.10
	riastradh-drm2-base1:1.10
	riastradh-drm2:1.10.0.16
	riastradh-drm2-base:1.10
	netbsd-6-1:1.10.0.20
	netbsd-6-0-2-RELEASE:1.10
	netbsd-6-1-RELEASE:1.10
	netbsd-6-1-RC4:1.10
	netbsd-6-1-RC3:1.10
	agc-symver:1.10.0.18
	agc-symver-base:1.10
	netbsd-6-1-RC2:1.10
	netbsd-6-1-RC1:1.10
	yamt-pagecache-base8:1.10
	netbsd-5-2:1.4.0.24
	netbsd-6-0-1-RELEASE:1.10
	yamt-pagecache-base7:1.10
	netbsd-5-2-RELEASE:1.4
	netbsd-5-2-RC1:1.4
	matt-nb6-plus-nbase:1.10
	yamt-pagecache-base6:1.10
	netbsd-6-0:1.10.0.14
	netbsd-6-0-RELEASE:1.10
	netbsd-6-0-RC2:1.10
	tls-maxphys:1.10.0.12
	tls-maxphys-base:1.10
	matt-nb6-plus:1.10.0.10
	matt-nb6-plus-base:1.10
	netbsd-6-0-RC1:1.10
	yamt-pagecache-base5:1.10
	yamt-pagecache-base4:1.10
	netbsd-6:1.10.0.8
	netbsd-6-base:1.10
	netbsd-5-1-2-RELEASE:1.4
	netbsd-5-1-1-RELEASE:1.4
	yamt-pagecache-base3:1.10
	yamt-pagecache-base2:1.10
	yamt-pagecache:1.10.0.6
	yamt-pagecache-base:1.10
	cherry-xenmp:1.10.0.4
	cherry-xenmp-base:1.10
	bouyer-quota2-nbase:1.10
	bouyer-quota2:1.10.0.2
	bouyer-quota2-base:1.10
	matt-mips64-premerge-20101231:1.10
	matt-nb5-mips64-premerge-20101231:1.4
	matt-nb5-pq3:1.4.0.22
	matt-nb5-pq3-base:1.4
	netbsd-5-1:1.4.0.20
	netbsd-5-1-RELEASE:1.4
	netbsd-5-1-RC4:1.4
	matt-nb5-mips64-k15:1.4
	netbsd-5-1-RC3:1.4
	netbsd-5-1-RC2:1.4
	netbsd-5-1-RC1:1.4
	netbsd-5-0-2-RELEASE:1.4
	matt-nb5-mips64-premerge-20091211:1.4
	matt-premerge-20091211:1.7
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.4
	matt-nb4-mips64-k7-u2a-k9b:1.4
	matt-nb5-mips64-u1-k1-k5:1.4
	matt-nb5-mips64:1.4.0.18
	netbsd-5-0-1-RELEASE:1.4
	jym-xensuspend-nbase:1.6
	netbsd-5-0:1.4.0.16
	netbsd-5-0-RELEASE:1.4
	netbsd-5-0-RC4:1.4
	netbsd-5-0-RC3:1.4
	netbsd-5-0-RC2:1.4
	jym-xensuspend:1.4.0.14
	jym-xensuspend-base:1.6
	netbsd-5-0-RC1:1.4
	netbsd-5:1.4.0.12
	netbsd-5-base:1.4
	matt-mips64-base2:1.4
	matt-mips64:1.2.0.6
	mjf-devfs2:1.4.0.10
	mjf-devfs2-base:1.4
	netbsd-4-0-1-RELEASE:1.1
	wrstuden-revivesa-base-3:1.4
	wrstuden-revivesa-base-2:1.4
	wrstuden-fixsa-newbase:1.1
	wrstuden-revivesa-base-1:1.4
	yamt-pf42-base4:1.4
	yamt-pf42-base3:1.4
	hpcarm-cleanup-nbase:1.4
	yamt-pf42-baseX:1.4
	yamt-pf42-base2:1.4
	wrstuden-revivesa:1.4.0.8
	wrstuden-revivesa-base:1.4
	yamt-pf42:1.4.0.6
	yamt-pf42-base:1.4
	keiichi-mipv6-nbase:1.4
	keiichi-mipv6:1.4.0.4
	keiichi-mipv6-base:1.4
	matt-armv6-nbase:1.4
	matt-armv6-prevmlocking:1.2.4.1
	wrstuden-fixsa-base-1:1.1
	netbsd-4-0:1.1.0.26
	netbsd-4-0-RELEASE:1.1
	cube-autoconf:1.4.0.2
	cube-autoconf-base:1.4
	netbsd-4-0-RC5:1.1
	netbsd-4-0-RC4:1.1
	netbsd-4-0-RC3:1.1
	netbsd-4-0-RC2:1.1
	netbsd-4-0-RC1:1.1
	matt-armv6:1.2.0.4
	matt-armv6-base:1.4
	matt-mips64-base:1.2
	hpcarm-cleanup:1.2.0.2
	hpcarm-cleanup-base:1.4
	netbsd-3-1-1-RELEASE:1.1
	netbsd-3-0-3-RELEASE:1.1
	wrstuden-fixsa:1.1.0.24
	wrstuden-fixsa-base:1.1
	abandoned-netbsd-4-base:1.1
	abandoned-netbsd-4:1.1.0.18
	netbsd-3-1:1.1.0.20
	netbsd-3-1-RELEASE:1.1
	netbsd-3-0-2-RELEASE:1.1
	netbsd-3-1-RC4:1.1
	netbsd-3-1-RC3:1.1
	netbsd-3-1-RC2:1.1
	netbsd-3-1-RC1:1.1
	netbsd-4:1.1.0.22
	netbsd-4-base:1.1
	netbsd-3-0-1-RELEASE:1.1
	netbsd-3-0:1.1.0.16
	netbsd-3-0-RELEASE:1.1
	netbsd-3-0-RC6:1.1
	netbsd-3-0-RC5:1.1
	netbsd-3-0-RC4:1.1
	netbsd-3-0-RC3:1.1
	netbsd-3-0-RC2:1.1
	netbsd-3-0-RC1:1.1
	netbsd-2-0-3-RELEASE:1.1
	netbsd-2-1:1.1.0.14
	netbsd-2-1-RELEASE:1.1
	netbsd-2-1-RC6:1.1
	netbsd-2-1-RC5:1.1
	netbsd-2-1-RC4:1.1
	netbsd-2-1-RC3:1.1
	netbsd-2-1-RC2:1.1
	netbsd-2-1-RC1:1.1
	netbsd-2-0-2-RELEASE:1.1
	netbsd-3:1.1.0.12
	netbsd-3-base:1.1
	netbsd-2-0-1-RELEASE:1.1
	netbsd-2:1.1.0.10
	netbsd-2-base:1.1
	netbsd-2-0-RELEASE:1.1
	netbsd-2-0-RC5:1.1
	netbsd-2-0-RC4:1.1
	netbsd-2-0-RC3:1.1
	netbsd-2-0-RC2:1.1
	netbsd-2-0-RC1:1.1
	netbsd-2-0:1.1.0.8
	netbsd-2-0-base:1.1
	netbsd-1-6-PATCH002-RELEASE:1.1
	netbsd-1-6-PATCH002:1.1
	netbsd-1-6-PATCH002-RC4:1.1
	netbsd-1-6-PATCH002-RC3:1.1
	netbsd-1-6-PATCH002-RC2:1.1
	netbsd-1-6-PATCH002-RC1:1.1
	netbsd-1-6-PATCH001:1.1
	netbsd-1-6-PATCH001-RELEASE:1.1
	netbsd-1-6-PATCH001-RC3:1.1
	netbsd-1-6-PATCH001-RC2:1.1
	netbsd-1-6-PATCH001-RC1:1.1
	fvdl_fs64_base:1.1
	netbsd-1-6-RELEASE:1.1
	netbsd-1-6-RC3:1.1
	netbsd-1-6-RC2:1.1
	netbsd-1-6-RC1:1.1
	netbsd-1-6:1.1.0.6
	netbsd-1-6-base:1.1
	netbsd-1-5-PATCH003:1.1
	netbsd-1-5-PATCH002:1.1
	netbsd-1-5-PATCH001:1.1
	netbsd-1-5-RELEASE:1.1
	netbsd-1-5-BETA2:1.1
	netbsd-1-5-BETA:1.1
	netbsd-1-5-ALPHA2:1.1
	netbsd-1-5:1.1.0.4
	netbsd-1-5-base:1.1
	minoura-xpg4dl-base:1.1
	minoura-xpg4dl:1.1.0.2;
locks; strict;
comment	@# @;


1.11
date	2025.04.01.11.39.19;	author brad;	state Exp;
branches;
next	1.10;
commitid	ECGJDadTJWum8lPF;

1.10
date	2010.12.14.08.04.14;	author pooka;	state Exp;
branches
	1.10.58.1;
next	1.9;

1.9
date	2010.12.13.18.00.38;	author pooka;	state Exp;
branches;
next	1.8;

1.8
date	2010.11.05.13.42.37;	author pooka;	state Exp;
branches;
next	1.7;

1.7
date	2009.10.29.14.38.37;	author christos;	state Exp;
branches;
next	1.6;

1.6
date	2009.04.22.15.23.03;	author lukem;	state Exp;
branches;
next	1.5;

1.5
date	2009.04.20.16.05.30;	author drochner;	state Exp;
branches;
next	1.4;

1.4
date	2007.10.07.12.19.37;	author xtraeme;	state Exp;
branches
	1.4.14.1;
next	1.3;

1.3
date	2007.10.07.04.16.47;	author xtraeme;	state Exp;
branches;
next	1.2;

1.2
date	2007.07.01.07.39.45;	author xtraeme;	state Exp;
branches
	1.2.4.1;
next	1.1;

1.1
date	2000.03.10.05.51.57;	author groo;	state Exp;
branches;
next	;

1.10.58.1
date	2025.08.02.05.58.49;	author perseant;	state Exp;
branches;
next	;
commitid	23j6GFaDws3O875G;

1.4.14.1
date	2009.05.13.19.20.22;	author jym;	state Exp;
branches;
next	;

1.2.4.1
date	2007.11.06.23.36.23;	author matt;	state Exp;
branches;
next	;


desc
@@


1.11
log
@

New features for envstat(8).

o The usual output of envstat(8) is meant for human consumption and it
is harder than it needs to be to extract the data and process it with
or for other systems or programs.  There is a '-x' flag to output the
raw XML from the envsys(4) framework, but that doesn't run the data
though the conversions that envstat(8) does in the human output case.
So, provide a '-j' flag that outputs in JSON.  Each execution of
envstat(8) will produce consistent JSON that can be piped directly
into the 'jq' command, for example.  When used with the interval flag,
'-i', each interval will be consistent JSON with a separator string to
make it easier to split the input.

(as an aside, there is a '-n' option too, that just extracts the
current value from each sensor, but that is a little too terse for the
cases where a device provides multiple sensors or if you ask for
multiple devices, as you lose the ability to know what each value is
associated with)

o Provide a '-t' flag that will time stamp the output with the time
that the extraction was executed.  This is only provided for the human
output, or JSON output.  In the human output case, the first line is a
human readable date and time.  In the JSON case, an object is included
in the output that contains the human readable date and time, and
another object that contains the Unix epoch version of the same.  This
makes it possible to extract the data and have the data tell you when
it was executed.


I have been using this for a little while and it seems to work quite
well when one needs to pull a lot of sensors from the envsys(4)
framework at one time.  It has ended up being much faster and less
error prone in a lot of cases then parsing the human output of
envstat(8) with regexs.
@
text
@# $NetBSD: Makefile,v 1.10 2010/12/14 08:04:14 pooka Exp $

RUMPPRG=	envstat
SRCS+=		envstat.c config.c config_yacc.y config_lex.l

.PATH: ${.CURDIR}/../../common/lib/libprop
CPPFLAGS+=	-DRUMP_ACTION
RUMPSRCS+=	prop_kern.c

LDADD=		-lprop -lmj
DPADD=		${LIBPROP} ${LIBMJ}

MAN=		envstat.8 envsys.conf.5

CPPFLAGS+=      -I${.CURDIR} -I.

YHEADER=	yes

.include <bsd.prog.mk>
@


1.10
log
@Use a consistent approach for rump kernel calls made by libs.
Should investigate a dynamic approach in the future.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.9 2010/12/13 18:00:38 pooka Exp $
d10 2
a11 2
LDADD=		-lprop
DPADD=		${LIBPROP}
@


1.10.58.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.11 2025/04/01 11:39:19 brad Exp $
d10 2
a11 2
LDADD=		-lprop -lmj
DPADD=		${LIBPROP} ${LIBMJ}
@


1.9
log
@RUMP_ACTION -> RUMPPRG
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.8 2010/11/05 13:42:37 pooka Exp $
d6 4
@


1.8
log
@support rump client mode
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2009/10/29 14:38:37 christos Exp $
d3 1
a3 1
PROG=		envstat
a14 7
.ifdef RUMP_ACTION
LDADD+=		-lrumpclient
CPPFLAGS+=	-DRUMP_SYS_OPEN -DRUMP_SYS_CLOSE
CPPFLAGS+=	-DRUMP_ACTION
DBG=		-g
.endif

@


1.7
log
@option noinput nounput
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2009/04/22 15:23:03 lukem Exp $
d15 7
@


1.6
log
@Enable WARNS=4 by default, except for:
	cpuctl  dumplfs  hprop  ipf  iprop-log  kadmin  kcm  kdc  kdigest
	kimpersonate  kstash  ktutil  makefs  ndbootd  ntp  pppd  quot
	racoon  racoonctl  rtadvd  sntp  sup  tcpdchk  tcpdmatch  tcpdump
	traceroute  traceroute6  user  veriexecgen  wsmoused  zic
(Mostly third-party applications)
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2009/04/20 16:05:30 drochner Exp $
d11 1
a11 1
CPPFLAGS+=      -I${.CURDIR} -I. -DYY_NO_INPUT
@


1.5
log
@define YY_NO_INPUT where appropriate, from Kurt J. Lidl per PR misc/41160
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2007/10/07 12:19:37 xtraeme Exp $
a9 1
WARNS=		4
@


1.4
log
@Pass -I${.CURDIR} -I. like others do.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2007/10/07 04:16:47 xtraeme Exp $
d12 1
a12 1
CPPFLAGS+=      -I${.CURDIR} -I.
@


1.4.14.1
log
@Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2009/04/22 15:23:03 lukem Exp $
d10 1
d12 1
a12 1
CPPFLAGS+=      -I${.CURDIR} -I. -DYY_NO_INPUT
@


1.3
log
@New configuration file format for the envsys framework:

foo0 {
	#
	# CPU Temperature
	#
	sensor0 {
		critical-max = 70C;
		critical-min = 20C;
	}
	...
}
...

Removed the -m flag that was previously used to set properties for
sensors. Now the -c flag will process all properties specified in
the file (accepted as argument).

To remove all properties that were set, the new -S flag can be used.
This will restore default values for all devices.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2007/07/01 07:39:45 xtraeme Exp $
d12 2
@


1.2
log
@Imported envsys 2, a brief description of the new features:
(Part 3: userland)

* Support for detachable sensors.
* Cleaned up the API for simplicity and efficiency.
* Ability to send capacity/critical/warning events to powerd(8).
* Adapted all the code to the new locking order.
* Compatibility with the old envsys API: the ENVSYS_GTREINFO
  and ENVSYS_GTREDATA ioctl(2)s are supported.
* Added support for a 'dictionary based communication channel' between
  sysmon_power(9) and powerd(8), that means there is no 32 bytes event
  size restriction anymore.
* Binary compatibility with old envstat(8) and powerd(8) via COMPAT_40.
* All drivers with the n^2 gtredata bug were fixed, PR kern/36226.

Tested by:

blymn: smsc(4).
bouyer: ipmi(4), mfi(4).
kefren: ug(4).
njoly: viaenv(4), adt7463.c.
riz: owtemp(4).
xtraeme: acpiacad(4), acpibat(4), acpitz(4), aiboost(4), it(4), lm(4).
@
text
@d1 1
a1 1
# $NetBSD$
d3 2
a4 1
PROG=	envstat
d6 2
a7 2
LDADD=	-lprop
DPADD=	${LIBPROP}
d9 4
a12 2
MAN=	${PROG}.8
WARNS=	4
@


1.2.4.1
log
@sync with HEAD
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.4 2007/10/07 12:19:37 xtraeme Exp $
d3 1
a3 2
PROG=		envstat
SRCS+=		envstat.c config.c config_yacc.y config_lex.l
d5 2
a6 2
LDADD=		-lprop
DPADD=		${LIBPROP}
d8 2
a9 6
MAN=		envstat.8 envsys.conf.5
WARNS=		4

CPPFLAGS+=      -I${.CURDIR} -I.

YHEADER=	yes
@


1.1
log
@Add envstat(8) for displaying sensor readings from any envsys(4)
compatible device.
@
text
@d1 1
a1 2
#	$NetBSD$
#	@@(#)Makefile	8.1 (Berkeley) 6/6/93
d4 6
a9 1
MAN=	envstat.8
@

