head 1.2; access; symbols netbsd-10-0-RC6:1.2 netbsd-10-0-RC5:1.2 netbsd-10-0-RC4:1.2 netbsd-10-0-RC3:1.2 netbsd-10-0-RC2:1.2 thorpej-ifq:1.2.0.56 thorpej-ifq-base:1.2 thorpej-altq-separation:1.2.0.54 thorpej-altq-separation-base:1.2 netbsd-10-0-RC1:1.2 netbsd-10:1.2.0.52 netbsd-10-base:1.2 bouyer-sunxi-drm:1.2.0.50 bouyer-sunxi-drm-base:1.2 netbsd-9-3-RELEASE:1.2 thorpej-i2c-spi-conf2:1.2.0.48 thorpej-i2c-spi-conf2-base:1.2 thorpej-futex2:1.2.0.46 thorpej-futex2-base:1.2 thorpej-cfargs2:1.2.0.44 thorpej-cfargs2-base:1.2 cjep_sun2x-base1:1.2 cjep_sun2x:1.2.0.42 cjep_sun2x-base:1.2 cjep_staticlib_x-base1:1.2 netbsd-9-2-RELEASE:1.2 cjep_staticlib_x:1.2.0.40 cjep_staticlib_x-base:1.2 thorpej-i2c-spi-conf:1.2.0.38 thorpej-i2c-spi-conf-base:1.2 thorpej-cfargs:1.2.0.36 thorpej-cfargs-base:1.2 thorpej-futex:1.2.0.34 thorpej-futex-base:1.2 netbsd-9-1-RELEASE:1.2 bouyer-xenpvh-base2:1.2 phil-wifi-20200421:1.2 bouyer-xenpvh-base1:1.2 phil-wifi-20200411:1.2 bouyer-xenpvh:1.2.0.32 bouyer-xenpvh-base:1.2 is-mlppp:1.2.0.30 is-mlppp-base:1.2 phil-wifi-20200406:1.2 netbsd-8-2-RELEASE:1.2 ad-namecache-base3:1.2 netbsd-9-0-RELEASE:1.2 netbsd-9-0-RC2:1.2 ad-namecache-base2:1.2 ad-namecache-base1:1.2 ad-namecache:1.2.0.28 ad-namecache-base:1.2 netbsd-9-0-RC1:1.2 phil-wifi-20191119:1.2 netbsd-9:1.2.0.26 netbsd-9-base:1.2 phil-wifi-20190609:1.2 netbsd-8-1-RELEASE:1.2 netbsd-8-1-RC1:1.2 isaki-audio2:1.2.0.24 isaki-audio2-base:1.2 pgoyette-compat-merge-20190127:1.2 pgoyette-compat-20190127:1.2 pgoyette-compat-20190118:1.2 pgoyette-compat-1226:1.2 pgoyette-compat-1126:1.2 pgoyette-compat-1020:1.2 pgoyette-compat-0930:1.2 pgoyette-compat-0906:1.2 pgoyette-compat-0728:1.2 netbsd-8-0-RELEASE:1.2 phil-wifi:1.2.0.22 phil-wifi-base:1.2 pgoyette-compat-0625:1.2 netbsd-8-0-RC2:1.2 pgoyette-compat-0521:1.2 pgoyette-compat-0502:1.2 pgoyette-compat-0422:1.2 netbsd-8-0-RC1:1.2 pgoyette-compat-0415:1.2 pgoyette-compat-0407:1.2 pgoyette-compat-0330:1.2 pgoyette-compat-0322:1.2 pgoyette-compat-0315:1.2 pgoyette-compat:1.2.0.20 pgoyette-compat-base:1.2 tls-maxphys:1.2.0.18 tls-maxphys-base-20171202:1.2 matt-nb8-mediatek:1.2.0.16 matt-nb8-mediatek-base:1.2 nick-nhusb-base-20170825:1.2 perseant-stdc-iso10646:1.2.0.14 perseant-stdc-iso10646-base:1.2 netbsd-8:1.2.0.12 netbsd-8-base:1.2 prg-localcount2-base3:1.2 prg-localcount2-base2:1.2 prg-localcount2-base1:1.2 prg-localcount2:1.2.0.10 prg-localcount2-base:1.2 pgoyette-localcount-20170426:1.2 bouyer-socketcan-base1:1.2 jdolecek-ncq:1.2.0.8 jdolecek-ncq-base:1.2 pgoyette-localcount-20170320:1.2 nick-nhusb-base-20170204:1.2 bouyer-socketcan:1.2.0.6 bouyer-socketcan-base:1.2 pgoyette-localcount-20170107:1.2 nick-nhusb-base-20161204:1.2 pgoyette-localcount-20161104:1.2 nick-nhusb-base-20161004:1.2 localcount-20160914:1.2 pgoyette-localcount-20160806:1.2 pgoyette-localcount-20160726:1.2 pgoyette-localcount:1.2.0.4 pgoyette-localcount-base:1.2 nick-nhusb-base-20160907:1.2 nick-nhusb:1.2.0.2 nick-nhusb-base-20160529:1.2; locks; strict; comment @# @; 1.2 date 2016.05.12.00.35.10; author mrg; state Exp; branches 1.2.2.1 1.2.18.1; next 1.1; commitid yd8KAtQKA1a2U76z; 1.1 date 2016.05.11.09.22.55; author mrg; state Exp; branches; next ; commitid UAg5o6eSxxwAQ26z; 1.2.2.1 date 2016.05.12.00.35.10; author skrll; state dead; branches; next 1.2.2.2; commitid 8mlnPW6uSaJU1m8z; 1.2.2.2 date 2016.05.29.08.44.37; author skrll; state Exp; branches; next ; commitid 8mlnPW6uSaJU1m8z; 1.2.18.1 date 2016.05.12.00.35.10; author jdolecek; state dead; branches; next 1.2.18.2; commitid XcIYRZTAh1LmerhA; 1.2.18.2 date 2017.12.03.11.38.44; author jdolecek; state Exp; branches; next ; commitid XcIYRZTAh1LmerhA; desc @@ 1.2 log @make '$e' in here the whole structure instead of a pointer, to combine several pointer derefs into one speaking this up significantly. @ text @# $NetBSD: kernhist,v 1.1 2016/05/11 09:22:55 mrg Exp $ # by mrg and skrll define kernhist dont-repeat set $hist = (struct kern_history *)&$arg0 set $histf = $hist->f set $histn = $hist->n set $lcv = $histf printf "Kernel history %s has %d entries (next free %d)\n", $hist->name, $histn, $histf while (1) set $e = $hist->e[$lcv] set $fmt = $e.fmt if ($fmt) printf "%06lx.%06d ", $e.tv.tv_sec, $e.tv.tv_usec printf "%s#%ld@@%d: ", $e.fn, $e.call, $e.cpunum printf "%s: %lx %lx %lx %lx\n", $fmt, $e.v[0], $e.v[1], $e.v[2], $e.v[3] set $lcv = ($lcv + 1) % $histn else if ($histf == 0) printf "No entries\n" loop_break end # if fmt is NULL and hist->f isn't zero, skip back to # the start of the list since it hasn't looped yet. set $lcv = 0 end if ($lcv == $histf) loop_break end end end document kernhist dump a kernel hist. eg, "kernhist usbhist". note that the format is not expanded due to there being now way to pass a variable format string to gdb's printf. end @ 1.2.18.1 log @file kernhist was added on branch tls-maxphys on 2017-12-03 11:38:44 +0000 @ text @d1 42 @ 1.2.18.2 log @update from HEAD @ text @a0 42 # $NetBSD$ # by mrg and skrll define kernhist dont-repeat set $hist = (struct kern_history *)&$arg0 set $histf = $hist->f set $histn = $hist->n set $lcv = $histf printf "Kernel history %s has %d entries (next free %d)\n", $hist->name, $histn, $histf while (1) set $e = $hist->e[$lcv] set $fmt = $e.fmt if ($fmt) printf "%06lx.%06d ", $e.tv.tv_sec, $e.tv.tv_usec printf "%s#%ld@@%d: ", $e.fn, $e.call, $e.cpunum printf "%s: %lx %lx %lx %lx\n", $fmt, $e.v[0], $e.v[1], $e.v[2], $e.v[3] set $lcv = ($lcv + 1) % $histn else if ($histf == 0) printf "No entries\n" loop_break end # if fmt is NULL and hist->f isn't zero, skip back to # the start of the list since it hasn't looped yet. set $lcv = 0 end if ($lcv == $histf) loop_break end end end document kernhist dump a kernel hist. eg, "kernhist usbhist". note that the format is not expanded due to there being now way to pass a variable format string to gdb's printf. end @ 1.2.2.1 log @file kernhist was added on branch nick-nhusb on 2016-05-29 08:44:37 +0000 @ text @d1 42 @ 1.2.2.2 log @Sync with HEAD @ text @a0 42 # $NetBSD: kernhist,v 1.2 2016/05/12 00:35:10 mrg Exp $ # by mrg and skrll define kernhist dont-repeat set $hist = (struct kern_history *)&$arg0 set $histf = $hist->f set $histn = $hist->n set $lcv = $histf printf "Kernel history %s has %d entries (next free %d)\n", $hist->name, $histn, $histf while (1) set $e = $hist->e[$lcv] set $fmt = $e.fmt if ($fmt) printf "%06lx.%06d ", $e.tv.tv_sec, $e.tv.tv_usec printf "%s#%ld@@%d: ", $e.fn, $e.call, $e.cpunum printf "%s: %lx %lx %lx %lx\n", $fmt, $e.v[0], $e.v[1], $e.v[2], $e.v[3] set $lcv = ($lcv + 1) % $histn else if ($histf == 0) printf "No entries\n" loop_break end # if fmt is NULL and hist->f isn't zero, skip back to # the start of the list since it hasn't looped yet. set $lcv = 0 end if ($lcv == $histf) loop_break end end end document kernhist dump a kernel hist. eg, "kernhist usbhist". note that the format is not expanded due to there being now way to pass a variable format string to gdb's printf. end @ 1.1 log @add a gdb script to dump kernel histories. based upon a script by skrll, updated by myself to run faster and more stupidly (but more workingly.) normal gdb scripts don't seem to be able to call printf with the format string as a variable, so we simply print the format itself as a string and the (upto 4) arguments as unsigned long (how they're strored.) @ text @d1 1 a1 1 # $NetBSD$ d15 2 a16 2 set $e = &$hist->e[$lcv] set $fmt = $e->fmt d19 3 a21 3 printf "%06lx.%06d ", $e->tv.tv_sec, $e->tv.tv_usec printf "%s#%ld@@%d: ", $e->fn, $e->call, $e->cpunum printf "%s: %lx %lx %lx %lx\n", $fmt, $e->v[0], $e->v[1], $e->v[2], $e->v[3] @