The NetBSD Project

CVS log for src/usr.sbin/tprof/tprof.c

[BACK] Up to [cvs.NetBSD.org] / src / usr.sbin / tprof

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.18.2.2 / (download) - annotate - [select for diffs], Wed Jun 21 22:34:51 2023 UTC (9 months, 3 weeks ago) by martin
Branch: netbsd-10
CVS Tags: netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1
Changes since 1.18.2.1: +41 -4 lines
Diff to previous 1.18.2.1 (colored) to branchpoint 1.18 (colored) next main 1.19 (colored)

Pull up following revision(s) (requested by msaitoh in ticket #210):

	usr.sbin/tprof/tprof.8: revision 1.30
	sys/dev/tprof/tprof_x86_amd.c: revision 1.8
	sys/dev/tprof/tprof_armv8.c: revision 1.20
	sys/dev/tprof/tprof_types.h: revision 1.7
	sys/dev/tprof/tprof_x86_intel.c: revision 1.6
	sys/dev/tprof/tprof_x86_intel.c: revision 1.7
	sys/dev/tprof/tprof_x86_intel.c: revision 1.8
	sys/dev/tprof/tprof.c: revision 1.23
	usr.sbin/tprof/tprof.8: revision 1.25
	usr.sbin/tprof/tprof.8: revision 1.26
	usr.sbin/tprof/arch/tprof_x86.c: revision 1.16
	usr.sbin/tprof/tprof.8: revision 1.27
	usr.sbin/tprof/arch/tprof_x86.c: revision 1.17
	usr.sbin/tprof/tprof.8: revision 1.28
	usr.sbin/tprof/tprof.h: revision 1.5
	usr.sbin/tprof/tprof.8: revision 1.29
	sys/dev/tprof/tprof_armv7.c: revision 1.13
	usr.sbin/tprof/tprof_top.c: revision 1.9
	usr.sbin/tprof/tprof.c: revision 1.21

Add Cometlake support.

Obtain the number of general counters from CPUID 0xa.

Test cpuid_level in tprof_intel_ncounters().
This function is called before tprof_intel_ident().

KNF. No functional change.

Add two note to the tprof(8)'s manual page.
 - "list" command prints the maximum number of counters that can be used
   simultaneously.
 - multiple -e arguments can be specified.

Use the default counter if -e argument is not specified.
 monitor command:
     The default counter is selected if -e argument is not specified.
 list command:
     Print the name of the default counter for monitor and top command.

tprof.8: new sentence, new line

tprof(8): fix markup nits

tprof.8: fix typo, s/speficied/specified/

Revision 1.21 / (download) - annotate - [select for diffs], Mon Apr 17 08:37:24 2023 UTC (11 months, 3 weeks ago) by msaitoh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.20: +41 -4 lines
Diff to previous 1.20 (colored)

Use the default counter if -e argument is not specified.

 monitor command:
     The default counter is selected if -e argument is not specified.
 list command:
     Print the name of the default counter for monitor and top command.

Revision 1.18.2.1 / (download) - annotate - [select for diffs], Mon Dec 26 11:23:56 2022 UTC (15 months, 2 weeks ago) by martin
Branch: netbsd-10
Changes since 1.18: +4 -3 lines
Diff to previous 1.18 (colored)

Pull up following revision(s) (requested by ryo in ticket #24):

	usr.sbin/tprof/tprof.c: revision 1.19
	usr.sbin/tprof/tprof.c: revision 1.20

Reflect recent new options for top operation, add a and c

fixed parsing of event options.
if event option was specivied, it was stuck in a busy loop.

Revision 1.20 / (download) - annotate - [select for diffs], Mon Dec 26 08:00:13 2022 UTC (15 months, 2 weeks ago) by ryo
Branch: MAIN
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

fixed parsing of event options.
if event option was specivied, it was stuck in a busy loop.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Dec 26 03:25:55 2022 UTC (15 months, 2 weeks ago) by ryoon
Branch: MAIN
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

Reflect recent new options for top operation, add a and c

Revision 1.18 / (download) - annotate - [select for diffs], Fri Dec 16 08:02:04 2022 UTC (15 months, 4 weeks ago) by ryo
Branch: MAIN
CVS Tags: netbsd-10-base
Branch point for: netbsd-10
Changes since 1.17: +99 -19 lines
Diff to previous 1.17 (colored)

the "scale" option can be specified in the event name even in "tprof monitor"

Revision 1.17 / (download) - annotate - [select for diffs], Mon Dec 5 05:02:45 2022 UTC (16 months, 1 week ago) by ryo
Branch: MAIN
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (colored)

fix build error with llvm

Revision 1.16 / (download) - annotate - [select for diffs], Thu Dec 1 00:43:27 2022 UTC (16 months, 1 week ago) by ryo
Branch: MAIN
Changes since 1.15: +17 -8 lines
Diff to previous 1.15 (colored)

add "top" subcommand to tprof(8)

Revision 1.15 / (download) - annotate - [select for diffs], Thu Dec 1 00:40:05 2022 UTC (16 months, 1 week ago) by ryo
Branch: MAIN
Changes since 1.14: +187 -35 lines
Diff to previous 1.14 (colored)

Improve tprof(8)

- Added "tprof count" subcommand to perform counts only.
- Event options (u,k) are now optional. The default value is both userland and kernel. (:uk)
- Event counters can be displayed with SIGINFO during `tprof monitor' or `tprof count'.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Dec 1 00:32:52 2022 UTC (16 months, 1 week ago) by ryo
Branch: MAIN
Changes since 1.13: +42 -21 lines
Diff to previous 1.13 (colored)

Improve tprof(4)

- Multiple events can now be handled simultaneously.
- Counters should be configured with TPROF_IOC_CONFIGURE_EVENT in advance,
  instead of being configured at TPROF_IOC_START.
- The configured counters can be started and stopped repeatedly by
  PROF_IOC_START/TPROF_IOC_STOP.
- The value of the performance counter can be obtained at any timing as a 64bit
  value with TPROF_IOC_GETCOUNTS.
- Backend common parts are handled in tprof.c as much as possible, and functions
  on the tprof_backend side have been reimplemented to be more primitive.
- The reset value of counter overflows for profiling can now be adjusted.
  It is calculated by default from the CPU clock (speed of cycle counter) and
  TPROF_HZ, but for some events the value may be too large to be sufficient for
  profiling. The event counter can be specified as a ratio to the default or as
  an absolute value when configuring the event counter.
- Due to overall changes, API and ABI have been changed. TPROF_VERSION and
  TPROF_BACKEND_VERSION were updated.

Revision 1.5.40.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:10:43 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.5: +135 -43 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Sync with HEAD

Revision 1.5.38.1 / (download) - annotate - [select for diffs], Sat Jul 28 04:38:15 2018 UTC (5 years, 8 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.5: +135 -43 lines
Diff to previous 1.5 (colored) next main 1.6 (colored)

Sync with HEAD

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jul 24 09:50:37 2018 UTC (5 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, 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, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Use errx, there is no errno.

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jul 18 16:50:05 2018 UTC (5 years, 8 months ago) by wiz
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Various improvements to man page. Sync usage.

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jul 14 16:34:15 2018 UTC (5 years, 9 months ago) by jmcneill
Branch: MAIN
Changes since 1.10: +5 -2 lines
Diff to previous 1.10 (colored)

Fix a crash when running tprof with no arguments; check argc before accessing argv[0]

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jul 13 19:54:53 2018 UTC (5 years, 9 months ago) by joerg
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

Mark tprof_monitor as dead

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jul 13 12:04:50 2018 UTC (5 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.8: +7 -4 lines
Diff to previous 1.8 (colored)

Ask for a file path with the "analyze" command, instead of reading stdin.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jul 13 11:03:36 2018 UTC (5 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.7: +6 -3 lines
Diff to previous 1.7 (colored)

Merge tpfmt(1) into tprof(8). We want to have access to everything with
only one tool. The code is copied mostly as-is, and the functionality is
available via the "analyze" command.

Eg:
	tprof monitor -e llc-misses:k -o myfile.out sleep 20
	tprof analyze < myfile.out

Will move soon, I don't like the reading via stdin.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Jul 13 09:04:31 2018 UTC (5 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.6: +79 -53 lines
Diff to previous 1.6 (colored)

Change the arguments of the tprof tool, to match the behavior of pmc(1) and
cpuctl(8). They become:

	tprof list
	tprof monitor -e name:option [-o outfile] command

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jul 13 07:56:29 2018 UTC (5 years, 9 months ago) by maxv
Branch: MAIN
Changes since 1.5: +77 -20 lines
Diff to previous 1.5 (colored)

Revamp tprof.

Rewrite the Intel backend to use the generic PMC interface, which is
available on all Intel CPUs. Synchronize the AMD backend with the new
interface.

The kernel identifies the PMC interface, and gives its id to userland.
Userland then queries the events itself (via cpuid etc). These events
depend on the PMC interface.

The tprof utility is rewritten to allow the user to choose which event
to count (which was not possible until now, the event was hardcoded in
the backend). The command line format is based on usr.bin/pmc, eg:

	tprof -e llc-misses:k -o output sleep 20

The man page is updated too, but the arguments will likely change soon
anyway so it doesn't matter a lot.

The tprof utility has three tables:

	Intel Architectural Version 1
	Intel Skylake/Kabylake
	AMD Family 10h

A CPU can support a combination of tables. For example Kabylake has
Intel-Architectural-Version-1 and its own Intel-Kabylake table.

For now the Intel Skylake/Kabylake table contains only one event, just
to demonstrate that the combination of tables works. Tested on an
Intel Core i5 Kabylake.

The code for AMD Family 10h is taken from the code I had written for
usr.bin/pmc. I haven't tested it yet, but it's the same as pmc(1), so
I guess it works as-is.

The whole thing is written in such a way that (I think) it is not
complicated to add more CPU models, and more architectures (other than
x86).

Revision 1.4.8.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:09:54 2012 UTC (11 years, 11 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored) next main 1.5 (colored)

sync with head

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jan 10 23:39:33 2012 UTC (12 years, 3 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, tls-maxphys-base, tls-maxphys, tls-earlyentropy-base, tls-earlyentropy, 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, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, 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-base, 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, perseant-stdc-iso10646-base, perseant-stdc-iso10646, 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, 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, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, 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, netbsd-6, matt-nb8-mediatek-base, matt-nb8-mediatek, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, agc-symver-base, agc-symver
Branch point for: phil-wifi, pgoyette-compat
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

Use __dead

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jan 26 05:53:10 2009 UTC (15 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, matt-premerge-20091211, matt-mips64-premerge-20101231, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

fix an error message.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jan 3 07:20:57 2009 UTC (15 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.2: +6 -6 lines
Diff to previous 1.2 (colored)

fix exit status values.

Revision 1.2.2.2 / (download) - annotate - [select for diffs], Wed Jan 9 02:02:35 2008 UTC (16 years, 3 months ago) by matt
Branch: matt-armv6
Changes since 1.2.2.1: +215 -0 lines
Diff to previous 1.2.2.1 (colored) to branchpoint 1.2 (colored) next main 1.3 (colored)

sync with HEAD

Revision 1.2.2.1, Thu Jan 3 15:01:07 2008 UTC (16 years, 3 months ago) by matt
Branch: matt-armv6
Changes since 1.2: +0 -215 lines
FILE REMOVED

file tprof.c was added on branch matt-armv6 on 2008-01-09 02:02:35 +0000

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jan 3 15:01:07 2008 UTC (16 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, 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, mjf-devfs2, 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, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-nbase, keiichi-mipv6-base, keiichi-mipv6, hpcarm-cleanup-nbase, hpcarm-cleanup-base
Branch point for: matt-armv6
Changes since 1.1: +8 -3 lines
Diff to previous 1.1 (colored)

usage: be a little more understandable.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jan 1 21:33:26 2008 UTC (16 years, 3 months ago) by yamt
Branch: MAIN

a dumb program to talk with the tprof driver.

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>