The NetBSD Project

CVS log for src/sys/dev/sysmon/sysmon_envsysvar.h

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / sysmon

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.48 / (download) - annotate - [select for diffs], Fri Dec 31 11:05:41 2021 UTC (2 years, 2 months ago) by riastradh
Branch: MAIN
CVS Tags: triaxx-drm, thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.47: +8 -8 lines
Diff to previous 1.47 (colored)

sysmon: Delete trailing whitespace.  No functional change intended.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Nov 23 10:00:20 2014 UTC (9 years, 3 months ago) by ozaki-r
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-nhusb, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncqfixes-base, jdolecek-ncqfixes, jdolecek-ncq-base, jdolecek-ncq, isaki-audio2-base, isaki-audio2, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-xenpvh-base, bouyer-xenpvh, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Changes since 1.46: +2 -1 lines
Diff to previous 1.46 (colored)

Pull workqueue_destroy out of sme->sme_mtx

workqueue_destroy may sleep so we shouldn't run it with holding a mutex.

Requested by riastradh@.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Dec 14 03:31:10 2012 UTC (11 years, 3 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, rmind-smpnet, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, khorben-n900, agc-symver-base, agc-symver
Changes since 1.45: +1 -2 lines
Diff to previous 1.45 (colored)

The sensor limit values were moved out of the event structure and into the
per-sensor structure a long time ago.  Garbage collect the old structure
member which is now unused.

Revision 1.45 / (download) - annotate - [select for diffs], Thu Sep 6 12:59:00 2012 UTC (11 years, 6 months ago) by macallan
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.44: +3 -1 lines
Diff to previous 1.44 (colored)

opt_envsys.h needs #ifdef _KERNEL_OPT
( thanks martin@ )

Revision 1.44 / (download) - annotate - [select for diffs], Thu Sep 6 12:10:28 2012 UTC (11 years, 6 months ago) by macallan
Branch: MAIN
Changes since 1.43: +3 -1 lines
Diff to previous 1.43 (colored)

defflag debug #defines

Revision 1.43 / (download) - annotate - [select for diffs], Mon Aug 27 21:42:04 2012 UTC (11 years, 6 months ago) by pgoyette
Branch: MAIN
Changes since 1.42: +5 -3 lines
Diff to previous 1.42 (colored)

1. Enable use of FMONSTCHANGED events for INDICATOR sensors
2. Update handling of FMONCRITICAL event reporting.   The state
   transition does not require a corresponding change in value.

With these changes, you can now have an INDICATOR sensor that
reports the presence or absence of a device, and (if the device
is present) separately monitor it for proper functioning.

Should address the concerns expressed recently with the commit
of changes to wmi(4) BBU handling.

Revision 1.42 / (download) - annotate - [select for diffs], Sun Jul 15 17:41:39 2012 UTC (11 years, 8 months ago) by pgoyette
Branch: MAIN
Changes since 1.41: +2 -1 lines
Diff to previous 1.41 (colored)

When unregistering a sensor device, make sure we unregister and delete
all the associated events.

Revision 1.41 / (download) - annotate - [select for diffs], Sat Feb 18 01:08:00 2012 UTC (12 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base10
Changes since 1.40: +3 -2 lines
Diff to previous 1.40 (colored)

Don't export sysmon_envsys_list as a common.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jun 19 03:09:43 2011 UTC (12 years, 9 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, netbsd-6, jmcneill-usbmp
Changes since 1.39: +3 -1 lines
Diff to previous 1.39 (colored)

Add routine to lookup description tables by description instead of by
type.

Revision 1.39 / (download) - annotate - [select for diffs], Wed Jun 8 18:22:24 2011 UTC (12 years, 9 months ago) by pgoyette
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored)

Factor out some duplicated code to simplify maintenance.  Reduces
the source file by ~100 lines, and amd64 object file shrinks by
~650 bytes.

No functional change intended.

Revision 1.38 / (download) - annotate - [select for diffs], Thu Dec 30 03:59:59 2010 UTC (13 years, 2 months ago) by pgoyette
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231, jruoho-x86intr-base, jruoho-x86intr, cherry-xenmp-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: cherry-xenmp
Changes since 1.37: +2 -1 lines
Diff to previous 1.37 (colored)

When the user updates the sensor device's refresh timer, reset the
callout immediately rather than waiting for the previous timer to
expire.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Dec 15 17:17:17 2010 UTC (13 years, 3 months ago) by pgoyette
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored)

Extract searching of description tables into a single function, rather
than duplicating the code every time.  Minor reduction in code size
(about 1200 bytes on amd64), no change in functionality.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Apr 10 19:01:01 2010 UTC (13 years, 11 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

When removing sensor properties with envstat -S, ensure that drivers
which could have modified hardware state are informed so that original
state can be restored.

Welcome to 5.99.27

Revision 1.35 / (download) - annotate - [select for diffs], Thu Apr 1 12:16:14 2010 UTC (13 years, 11 months ago) by pgoyette
Branch: MAIN
Changes since 1.34: +2 -1 lines
Diff to previous 1.34 (colored)

Permit creation of an event-monitor for alarm limits even if the limits
are not currently set (and, in case of battery capacity sensors, if there
is no value_max).  Ensure that such an event-monitor does not trigger the
delivery of any actual events.

Provide a mechanism for sensors to set their limits at time other than
system startup (for example, when a battery is inserted).

This allows us to boot a system with a battery missing, install the
battery some time later, and automatically monitor it without requiring
any user intervention to create the event-monitor.  (The actual changes
for battery sensors to use this new capability will come later.)

Revision 1.34 / (download) - annotate - [select for diffs], Fri Mar 19 02:19:13 2010 UTC (14 years ago) by pgoyette
Branch: MAIN
Changes since 1.33: +1 -2 lines
Diff to previous 1.33 (colored)

Modify previous commit.  The routine to deliver events is intended to be
exported to device drivers, so rename it and move the declaration to
<dev/sysmon/sysmonvar.h>

Revision 1.33 / (download) - annotate - [select for diffs], Fri Mar 19 01:16:44 2010 UTC (14 years ago) by pgoyette
Branch: MAIN
Changes since 1.32: +4 -2 lines
Diff to previous 1.32 (colored)

Separate event delivery from polling and limit evaluation in
sme_events_worker().

Provide a wrapper that can be called from sensor drivers' interrupt
routines to find and deliver a specific event.

XXX Actually updating sensor drivers (and their parent devices) to
XXX have interrupts is a future enhancement.  This is simply an
XXX enabler.

Revision 1.32 / (download) - annotate - [select for diffs], Sun Mar 14 18:03:15 2010 UTC (14 years ago) by pgoyette
Branch: MAIN
Branch point for: rmind-uvmplock
Changes since 1.31: +1 -5 lines
Diff to previous 1.31 (colored)

Retire the 'monitor' member of the envsys_data_t.  It was only used in
one place, and functioned as a logical OR of the ENVSYS_FMON* flag bits.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Feb 14 23:06:02 2010 UTC (14 years, 1 month ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Remove the flags member of the limits structure.  Its value was only
meaningful for a few limited function calls;  all persitent storage
of limit-present flags is maintained in the edata->upropset member.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Jun 13 16:08:25 2009 UTC (14 years, 9 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, uebayasi-xip-base, matt-premerge-20091211, jymxensuspend-base, jym-xensuspend-nbase
Branch point for: uebayasi-xip
Changes since 1.29: +4 -7 lines
Diff to previous 1.29 (colored)

Add capability to send sensor limit values to the driver so they can
be programmed into device registers.  This way we can let the hardware
help us out instead of having to always compare the value against each
limit.  (Driver updates for some sensors to take advantage of this
capability will be forthcoming.)

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jun 8 00:55:35 2009 UTC (14 years, 9 months ago) by pgoyette
Branch: MAIN
Changes since 1.28: +3 -12 lines
Diff to previous 1.28 (colored)

General clean-up and some restructuring of event handling.  This is a
precursor to letting sensor drivers actually exchange limits/thresholds
with user-land.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Aug 22 11:27:50 2008 UTC (15 years, 7 months ago) by pgoyette
Branch: MAIN
CVS Tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, nick-hppapmap, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jym-xensuspend-base, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Changes since 1.27: +6 -4 lines
Diff to previous 1.27 (colored)

1. provide for warning-min and warning-max alarm levels in addition to
   critical-min and critical-max; also, a battery warning-capacity is
   added in addition to a critical-capacity.

2. usr.sbin/envstat is modified to introduce a -W command line switch to
   display the warning-* values instead of the critical-* values, and
   envstat(8) and envsys.conf(5) man pages are updated appropriately.

3. Treat user-defined limits as a single continuum and generate a single
   event regardless of how many boundaries a change in sensor value
   crosses;  ditto for driver-defined limits.

Fixes my PR/39021
Fixes my PR/39022

OK'd by christos@ bouyer@ cube@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Apr 1 12:25:30 2008 UTC (15 years, 11 months ago) by xtraeme
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, yamt-nfs-mp-base2, yamt-nfs-mp-base, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl, hpcarm-cleanup-nbase
Branch point for: yamt-nfs-mp, wrstuden-revivesa, haad-dm
Changes since 1.26: +7 -10 lines
Diff to previous 1.26 (colored)

Introduce per-device locking/synchronization and maintain only a
global mutex for the linked list of devices and the global proplib
dictionary.

This has improved locking contention a lot when multiple devices with
multiple monitoring events are running:

New:

 0.30      35      0.33 sme_global_mtx         sysmonioctl_envsys+28b
 0.10      10      0.11 00000000cd97feac       sysmon_envsys_acquire+4c
 0.08       6      0.09 00000000cd97feac       sme_update_dictionary+24f
 0.01       4      0.01 00000000cd97feac       sme_events_worker+2f
 0.01      10      0.01 00000000cd97fe2c       sysmon_envsys_acquire+4c
 0.00       1      0.00 00000000cd97fe2c       sysmon_envsys_release+3b
28.38      94      9.16 sme_global_mtx         sysmonioctl_envsys+28b
 4.54      74      1.47 00000000cd97fe2c       sysmon_envsys_acquire+4c
 0.06       3      0.02 00000000cd97fe2c       sysmon_envsys_release+3b
 0.03       1      0.01 00000000cd97fe2c       sme_events_worker+2f
 1.40      19      0.45 00000000cd97bee4       sysmon_envsys_acquire+4c

Old:

 4.25     313      4.74 sme_mtx                <all>
 3.12     185      3.49 sme_mtx                sme_events_worker+21
 1.12     128      1.25 sme_mtx                sysmonioctl_envsys+29b
34.75    1423     59.52 sme_mtx                <all>
22.08     477     37.82 sme_mtx                sysmonioctl_envsys+29b
12.67     946     21.70 sme_mtx                sme_events_worker+21

Revision 1.26 / (download) - annotate - [select for diffs], Tue Nov 20 17:24:32 2007 UTC (16 years, 4 months ago) by xtraeme
Branch: MAIN
CVS Tags: yamt-lazymbuf-base15, yamt-lazymbuf-base14, yamt-kmem-base3, yamt-kmem-base2, yamt-kmem-base, yamt-kmem, vmlocking2-base3, vmlocking2-base2, vmlocking2-base1, vmlocking2, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, jmcneill-pm-base, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf, bouyer-xeni386-nbase, bouyer-xeni386-merge1, bouyer-xeni386-base, bouyer-xeni386, bouyer-xenamd64-base2, bouyer-xenamd64-base, ad-socklock-base1
Branch point for: mjf-devfs2
Changes since 1.25: +1 -2 lines
Diff to previous 1.25 (colored)

After comments from Andrew Doran:

- The mutex for the callout handler must run at IPL_SOFTCLOCK.
- Just stop the callout in sysmon_envsys_unregister() and don't wait
  for the callout to finish.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Nov 16 08:18:33 2007 UTC (16 years, 4 months ago) by xtraeme
Branch: MAIN
Changes since 1.24: +1 -6 lines
Diff to previous 1.24 (colored)

Remove duplicate sme_events_list.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Nov 16 08:00:16 2007 UTC (16 years, 4 months ago) by xtraeme
Branch: MAIN
Changes since 1.23: +60 -31 lines
Diff to previous 1.23 (colored)

Extend the envsys2 API (one more time, sorry) as defined in:

http://mail-index.netbsd.org/tech-kern/2007/11/09/0001.html

sysmon_envsys_create() and sysmon_envsys_destroy() were added to
create/destroy sysmon_envsys objects (and its TAILQ/LIST for sensors/events).

sysmon_envsys_sensor_attach() and sysmon_envsys_sensor_detach() were
added to attach/detach sensors to a specified sysmon_envsys device.

The events framework is now per device and configurable via the
ENVSYS_SETDICTIONARY ioctl or /etc/envsys.conf and envstat(8).

Update all users and documentation to reflect these changes.

Revision 1.23 / (download) - annotate - [select for diffs], Sat Nov 3 23:05:22 2007 UTC (16 years, 4 months ago) by xtraeme
Branch: MAIN
CVS Tags: jmcneill-base
Branch point for: mjf-devfs
Changes since 1.22: +3 -2 lines
Diff to previous 1.22 (colored)

- Rename ENVSYS_BATTERY_STATE units to ENVSYS_BATTERY_CAPACITY and
  introduce ENVSYS_BATTERY_CHARGE, which is the same than an Indicator and
  it's used to know if the battery is currently charging or discharging.

- Require two sensors at least for SME_CLASS_BATTERY to make the low-power
  condition work: a ENVSYS_BATTERY_CAPACITY plus ENVSYS_BATTERY_CHARGE.

- Simplify sme_event_check_lowpower() and make it check the required
  sensors in the SME_CLASS_ACADAPTER and SME_CLASS_BATTERY classes.
  If the acadapter is not ready, trust the state returned by the battery
  device.

Based on suggestion from joerg@.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Oct 23 21:36:03 2007 UTC (16 years, 4 months ago) by xtraeme
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

Use a flag for see_flags to know when the sensor has been refreshed
rather than using a boolean. Suggested by rmind.

Revision 1.21 / (download) - annotate - [select for diffs], Sat Oct 20 00:12:35 2007 UTC (16 years, 5 months ago) by xtraeme
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored)

performance fix: in the workqueue handler only refresh the sensor once,
not multiple times for the same sensor and clear its state after all
events were processed.

Revision 1.20 / (download) - annotate - [select for diffs], Sun Oct 7 04:11:16 2007 UTC (16 years, 5 months ago) by xtraeme
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, vmlocking-base
Branch point for: bouyer-xenamd64
Changes since 1.19: +13 -23 lines
Diff to previous 1.19 (colored)

New changes to support the new configuration file format for
envstat(8) and the envsys framework:

- Modify the ENVSYS_SETDICTIONARY ioctl to support the following
  plist structure:

  <dict>
	<key>foo0</key>
	<array>
		<dict>
			<key>index</key>
			<string>sensor0</string>
			<key>description</key>
			<string>cpu temp</string>
			...
			Another property for this sensor
			...
		</dict>
		...
		Another dictionary for other sensor
		...
	</array>
	...
	Another device as above
	...
  </dict>

  Multiple devices with multiple sensors can now be specified, that means
  that to set the properties only one copyin(9) is needed now.

- Added the ENVSYS_REMOVEPROPS ioctl, that accepts a boolean object
  "envsys-remove-props" and when set to true, all properties that were
  set previously by ENVSYS_SETDICTIONARY will be removed. That means that
  you can now set multiple critical limits, descriptions and all they
  will be removed or changed to its default value (for rfact and
  description objects).

- Added the 'index' and 'allow-rfact' objects into the sensor dictionaries,
  for better interactivity with userland. To know the position of the
  sensor and to know if sensor allows to change the rfact.

- Misc cosmetic changes for consistency.

- Use a two clause license for all my code.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Sep 8 15:25:19 2007 UTC (16 years, 6 months ago) by xtraeme
Branch: MAIN
CVS Tags: yamt-x86pmap-base2, yamt-x86pmap-base, nick-csl-alignment-base5
Branch point for: yamt-x86pmap
Changes since 1.18: +4 -8 lines
Diff to previous 1.18 (colored)

Use only one single condvar(9) for devices and events, they are protected
by the same mutex (sme_mtx) and there's no point in using two of them.

Also add a comment mentioning some locking notes.

Reviewed and ok by rmind.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Sep 8 03:17:38 2007 UTC (16 years, 6 months ago) by xtraeme
Branch: MAIN
Changes since 1.17: +6 -5 lines
Diff to previous 1.17 (colored)

- Use only one global mutex for all tasks with devices & events.
- sysmon_envsys_register: use a SLIST to maintain allocated sme_event_drv_t
  structs for later use in sysmon_task_queue_sched(). This avoids a
  locking error acquiring/dropping the mutex multiple times.

Suggested by rmind.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Sep 4 16:54:02 2007 UTC (16 years, 6 months ago) by xtraeme
Branch: MAIN
Changes since 1.16: +16 -1 lines
Diff to previous 1.16 (colored)

- Remove ENVSYS_GSTRING and the genstr member from envsys_data_t.
  (at least three or four persons were against it).
- Add a new sensor type: ENVSYS_BATTERY_STATE, this uses value_cur
  and some predefined values in a static table, like ENVSYS_DRIVE.
- Move all static tables to sysmon_envsys_tables.c and use a function
  on it to retrieve a pointer to the struct of the specified type.
- Rename the ENVSYS_FMONDRVSTCHANGED to ENVSYS_FMONSTCHANGED and make
  it generic for Battery state and drive sensors (this flag enables
  monitoring on these sensors when state has been changed).
- Update sysmon_penvsys_event() to report state changes on
  ENVSYS_BATTERY_STATE sensors and remove other type of events, with
  PENVSYS_EVENT_STATE_CHANGED they are not necessary anymore.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Aug 31 22:44:39 2007 UTC (16 years, 6 months ago) by xtraeme
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

- sme_unregister_all: there's no need to use a struct sysmon_envsys as
  argument, just pass sme->sme_name to it.
- sysmon_envsys_register: drop the array in all cases, not just when
  there's an error. The reference is stored in the dictionary anyway...
- Update some comments.

Revision 1.15 / (download) - annotate - [select for diffs], Fri Aug 31 10:13:27 2007 UTC (16 years, 6 months ago) by xtraeme
Branch: MAIN
Changes since 1.14: +3 -4 lines
Diff to previous 1.14 (colored)

Merge sme_event_add() into sme_event_register()... there's no need
to have two different functions for this.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Aug 30 23:44:32 2007 UTC (16 years, 6 months ago) by xtraeme
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

More misc changes for sysmon_envsys(9):

- Add the SLIST for sensor descriptions and sme_uniqsensors into the
  struct sysmon_envsys (it's per device now).
- Use only one common struct with three members for the static tables
  (there's no need to have different structs just for them).
- While initializing/destroying the events framework, use the
  strategy specified by Andrew Doran in:
  http://mail-index.netbsd.org/tech-kern/2007/06/21/0025.html).

Revision 1.13 / (download) - annotate - [select for diffs], Thu Aug 30 18:01:26 2007 UTC (16 years, 6 months ago) by xtraeme
Branch: MAIN
Changes since 1.12: +3 -5 lines
Diff to previous 1.12 (colored)

Some changes to improve locking on sysmon_envsys(9):

- Remove sme_mtx, a global lock (sme_list_mtx) is used to access to
  the sysmon envsys device.
- Allocate memory with KM_NOSLEEP rather than KM_SLEEP if there's a
  mutex held, to avoid sleeping.
- Remove sysmon_envsys_createplist() and add the logic into
  sysmon_envsys_register().
- sysmon_envsys_register: allocate the array and dictionaries required
  in advance for a device before the locking and adding the objects
  into the array happens.
- Rename sme_make_dictionary() to sme_add_sensor_dictionary() and pass
  to it the dictionary on which the objects will be stored for a sensor.
- Improve locking here and there.

Thanks to Mindaugas Rasiukevicius and Andrew Doran for comments.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Jul 23 17:51:17 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
CVS Tags: matt-mips64-base, hpcarm-cleanup
Branch point for: matt-mips64, matt-armv6, jmcneill-pm
Changes since 1.11: +9 -4 lines
Diff to previous 1.11 (colored)

- ENVSYS_SETDICTIONARY: use sysmon_envsys_release() if there's an error.
- sme_events_worker: use sme_list_mtx when accessing to the sysmon_envsys
  linked list.
- Improve the comments in sysmon_envsysvar.h about the mutexes and condvar.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jul 22 18:17:03 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

Fix the last point reported by yamt in PR kern/36673:

- There must be three mandatory objects in a sensor to be valid and be
  enabled on its dictionary: units, state and desc. If any of these
  objects fails for some reason, its dictionary won't created in the
  array and sensor will be marked with ENVSYS_FNOTVALID in edata->flags.

  That means there won't never be a partial dictionary.

- Mark all invalid sensors and sensors with duplicate description with
  ENVSYS_FNOTVALID and remove ENVSYS_FDUPDESC. The former is the generic
  way to say that a sensor does not obey the rules and must be not
  created.

- sysmon_envsys_createplist: if the array does not contain any object,
  release the array and return the error.

And with all that stuff I can go to holidays and be happy.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jul 21 15:16:58 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.9: +3 -1 lines
Diff to previous 1.9 (colored)

- Add sme_events_destroy() to stop/destroy the callout and workqueue if
  there are no more events.
- Add sme_event_unregister_all() to remove all events associated with
  a device and use it in sysmon_envsys_unregister() to fix a "use-after-free".
- Check return error of sme_sensor_upfoo() in sme_make_dictionary() and
  return it rather than 0 all the time.
- Add more KASSERTS.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jul 21 12:11:27 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.8: +5 -9 lines
Diff to previous 1.8 (colored)

Some fixes for kern/36673 by yamt@:

- sme_register_sensorname: there's no need to handle empty list case.
- 'obj' argument in sme_sensor_upstring and similar functions is useless:
  removed the obj argument from the functions, it's handled in the function
  itself now.
- check for more errors in sme_make_dictionary() and
  sysmon_envsys_createplist().

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jul 20 14:10:22 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.7: +12 -115 lines
Diff to previous 1.7 (colored)

Move the functions to create/update objects in a dictionary into its
own file, and DO NOT MAKE THEM inline AS IT IS WRONG.

Looks like I'm very stupid and I didn't know what inline meant.
Thank you very much YAMAMOTO Takashi.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Jul 20 10:40:08 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.6: +113 -52 lines
Diff to previous 1.6 (colored)

Replace the macros to create/update objects in dictionary with three
inline functions, suggested by yamt@.

This also gets rid of a few gotos.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jul 19 00:28:47 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

Apply some indent to recent changes.

Revision 1.5 / (download) - annotate - [select for diffs], Wed Jul 18 20:31:48 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.4: +4 -1 lines
Diff to previous 1.4 (colored)

- More changes related to locking.
- Add a condvar(9) to protect deletions on the list if there's an event
  in the worker thread.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 18 20:09:49 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.3: +3 -12 lines
Diff to previous 1.3 (colored)

- Cleanup sme_event_t: just use the struct work without any union and
  remove the TAILQ.
- If prop_dictionary_set_* fails, do not release the object. The function
  calling it will release the object. Pointed out by yamt@.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Jul 5 23:48:22 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
CVS Tags: nick-csl-alignment-base, mjf-ufs-trans-base
Branch point for: vmlocking, nick-csl-alignment, mjf-ufs-trans
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

SENSOR_UPTYPE: accept values of 0 for any object, so that the value is
showed in its dictionary.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 3 22:33:36 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN
Changes since 1.1: +1 -9 lines
Diff to previous 1.1 (colored)

Make the refresh value of the callout function (that monitors the sensors)
configurable via sysctl. By default it uses 10 seconds, but it can be changed
between 1 second and 5 minutes.

$ sysctl -d kern.envsys
kern.envsys.refresh_value: wait time in seconds to refresh sensors being monitored
$

Revision 1.1 / (download) - annotate - [select for diffs], Sun Jul 1 07:36:56 2007 UTC (16 years, 8 months ago) by xtraeme
Branch: MAIN

Imported envsys 2, a brief description of the new features:
(Part 1: API)

* 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).

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>