aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/devicestat.h
Commit message (Collapse)AuthorAgeFilesLines
* devstat(9): Constify function parameters that can be constConrad Meyer2018-08-231-5/+6
| | | | | | | | | | | | | | | No functional change. When attempting to document the changed argument types in devstat.9, I discovered the 20 year old manual page severely mismatched reality even prior to my simple change. So I took a first cut pass cleaning that up to match reality. I'm sure I've missed some things; the goal was just to leave it better than when I started. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=338220
* sys/sys: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326256
* MFprojects/camlock r254905:Alexander Motin2013-10-161-0/+2
| | | | | | | | | Introduce new function devstat_end_transaction_bio_bt(), adding new argument to specify present time. Use this function to move binuptime() out of lock, substantially reducing lock congestion when slow timecounter is used. Notes: svn path=/head/; revision=256603
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139825
* Add an XXX comment with a TODO item for next time we run a revisionPoul-Henning Kamp2003-05-311-0/+5
| | | | | | | on this API. Notes: svn path=/head/; revision=115567
* Make devstat_new_entry() take a const void * rather than const char *Poul-Henning Kamp2003-03-181-1/+1
| | | | | | | argument, GEOM nodes are not identified by ascii string. Notes: svn path=/head/; revision=112365
* Add a #define for the device name of the mmap device for devstat.Poul-Henning Kamp2003-03-161-1/+6
| | | | | | | Constify the geom identification pointer. Notes: svn path=/head/; revision=112326
* Run a revision of the devstat interface:Poul-Henning Kamp2003-03-151-71/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel: Change statistics to use the *uptime() timescale (ie: relative to boottime) rather than the UTC aligned timescale. This makes the device statistics code oblivious to clock steps. Change timestamps to bintime format, they are cheaper. Remove the "busy_count", and replace it with two counter fields: "start_count" and "end_count", which are updated in the down and up paths respectively. This removes the locking constraint on devstat. Add a timestamp argument to devstat_start_transaction(), this will normally be a timestamp set by the *_bio() function in bp->bio_t0. Use this field to calculate duration of I/O operations. Add two timestamp arguments to devstat_end_transaction(), one is the current time, a NULL pointer means "take timestamp yourself", the other is the timestamp of when this transaction started (see above). Change calculation of busy_time to operate on "the salami principle": Only when we are idle, which we can determine by the start+end counts being identical, do we update the "busy_from" field in the down path. In the up path we accumulate the timeslice in busy_time and update busy_from. Change the byte_* and num_* fields into two arrays: bytes[] and operations[]. Userland: Change the misleading "busy_time" name to be called "snap_time" and make the time long double since that is what most users need anyway, fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same timescale as the kernel fields. Change devstat_compute_etime() to operate on struct bintime. Remove the version 2 legacy interface: the change to bintime makes compatibility far too expensive. Fix a bug in systat's "vm" page where boot relative busy times would be bogus. Bump __FreeBSD_version to 500107 Review & Collaboration by: ken Notes: svn path=/head/; revision=112288
* Add a devstat_start_transaction_bio() to match thePoul-Henning Kamp2003-03-151-0/+1
| | | | | | | | | | devstat_end_transaction_bio() we already have. For now it just calls devstat_start_transaction(), but that will change shortly. Notes: svn path=/head/; revision=112258
* Retire devstat_add_entry() as a public function and bump __FreeBSD_versionPoul-Henning Kamp2003-03-081-5/+0
| | | | | | | to mark this act. Notes: svn path=/head/; revision=112007
* Augment the devstat structure with 3 new fields and bump the DEVSTAT_VERSION.Poul-Henning Kamp2003-03-081-1/+14
| | | | | | | | | Two fields are sequence numbers for integrity check when we switch devstat to use mmap to export data rather than sysctl, the last field is to mark this as an allocated devstat entry. Notes: svn path=/head/; revision=112000
* Un-inline the non-trivial "trivial" bio* functions.Poul-Henning Kamp2002-09-141-2/+0
| | | | | | | Untangle devstat_end_transaction_bio() Notes: svn path=/head/; revision=103330
* Export the head structure for the device statistics STAILQ inThomas Moestl2001-08-041-0/+2
| | | | | | | | sys/devicestat.h, so that the queue can be walked in crashdumps using libkvm. Notes: svn path=/head/; revision=81129
* Actually biofinish(struct bio *, struct devstat *, int error) is more generalPoul-Henning Kamp2001-05-061-0/+2
| | | | | | | | | than the bioerror(). Most of this patch is generated by scripts. Notes: svn path=/head/; revision=76322
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-261-1/+1
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-231-1/+1
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Name the `struct bio *' parameter of devstat_end_transaction_bio().Bruce Evans2000-05-111-2/+2
| | | | | | | Removed the last vestige of devstat_end_transaction_buf(). Notes: svn path=/head/; revision=60395
* Remove devstat_end_transaction_buf() everybody usesPoul-Henning Kamp2000-05-061-1/+0
| | | | | | | devstat_end_transaction_bio() now. Notes: svn path=/head/; revision=60072
* Silence some warnings.Poul-Henning Kamp2000-04-031-0/+1
| | | | Notes: svn path=/head/; revision=58969
* Clone bio versions of certain bits of infrastructure:Poul-Henning Kamp2000-04-021-0/+1
| | | | | | | | | | | | | | | | devstat_end_transaction_bio() bioq_* versions of bufq_* incl bioqdisksort() the corresponding "buf" versions will disappear when no longer used. Move b_offset, b_data and b_bcount to struct bio. Add BIO_FORMAT as a hack for fd.c etc. We are now largely ready to start converting drivers to use struct bio instead of struct buf. Notes: svn path=/head/; revision=58942
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-291-1/+1
| | | | | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come. Notes: svn path=/head/; revision=55205
* Revamp the devstat priority system. All disks now have the same priority.Kenneth D. Merry1999-12-081-6/+3
| | | | | | | | | | | | | | | | | | | | | The same goes for CD drivers and tape drivers. In systems with mixed IDE and SCSI, devices in the same priority class will be sorted in attach order. Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of drivers have been modified to use that priority. This includes the necessary changes to all drivers, except the ATA drivers. Soren will modify those separately. This does not include and does not require any change in the devstat version number, since no known userland applications use the priority enumerations. Reviewed by: msmith, sos, phk, jlemon, mjacob, bde Notes: svn path=/head/; revision=54279
* Bump version number.Poul-Henning Kamp1999-09-181-1/+1
| | | | | | | Pointed out by: ken Notes: svn path=/head/; revision=51379
* Count "free" operations in their own new tranaction type.Poul-Henning Kamp1999-09-181-3/+15
| | | | | | | | | | WARNING: libdevstat, iostat, vmstat, systat etc etc will need a recompile. Add devstat_end_transaction_buf() which pulls all the vital data out of a struct buf which is ready for biodone(). Notes: svn path=/head/; revision=51375
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Add a prioritization field to the devstat_add_entry() call so thatKenneth D. Merry1999-02-101-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | peripheral drivers can determine where in the devstat(9) list they are inserted. This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and any ports that depend on the devstat code, since the size of the devstat structure has changed. The devstat version number has been incremented as well to reflect the change. This sorts devices in the devstat list in "more interesting" to "less interesting" order. So, for instance, da devices are now more important than floppy drives, and so will appear before floppy drives in the default output from systat, iostat, vmstat, etc. The order of devices is, for now, kept in a central table in devicestat.h. If individual drivers were able to make a meaningful decision on what priority they should be at attach time, we could consider splitting the priority information out into the various drivers. For now, though, they have no way of knowing that, so it's easier to put them in an easy to find table. Also, move the checkversion() call in vmstat(8) to a more logical place. Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and for putting up with the long time it has taken me to commit it. Bruce did object somewhat to the central priority table (he would rather the priorities be distributed in each driver), so his objection is duly noted here. Reviewed by: bde, obrien Notes: svn path=/head/; revision=43819
* My changes to the new device interface:Garrett Wollman1998-11-141-2/+2
| | | | | | | | | | | | | | | | | - Interface wth the new resource manager. - Allow for multiple drivers implementing a single devclass. - Remove ordering dependencies between header files. - Style cleanup. - Add DEVICE_SUSPEND and DEVICE_RESUME methods. - Move to a single-phase interrupt setup scheme. Kernel builds on the Alpha are brken until Doug gets a chance to incorporate these changes on that side. Agreed to in principle by: dfr Notes: svn path=/head/; revision=41153
* Change the devstat generation number from an int to a long. The int-sizedKenneth D. Merry1998-09-201-2/+2
| | | | | | | | | | | | | generation was causing unaligned access faults on the Alpha. I have incremented the devstat version number, since this is an interface change. You'll need to recompile libdevstat, systat, iostat, vmstat and rpc.rstatd along with your kernel. Partially Submitted by: Andrew Gallatin <gallatin@cs.duke.edu> Notes: svn path=/head/; revision=39498
* New Kernel device statistics code.Justin T. Gibbs1998-09-151-0/+196
Submitted by: "Kenneth D. Merry" <ken@plutotech.com> Notes: svn path=/head/; revision=39229