Commit Graph

45 Commits

Author SHA1 Message Date
mckusick
94e9fbbd05 Fix incorrect output when printing block lists for files small enough
to fit in only direct blocks whose size is exactly a multiple of the
filesystem block size.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix
2018-08-20 20:44:11 +00:00
mckusick
c2d88526f7 Fix incorrect output for a file consisting of a single full-size
block followed by a discontiguous fragment.

Add checks for unallocated inodes and inodes with unknown mode
types.

Cleanup variable declarations by changing from type `int' to types
like ufs_lbn_t, ufs2_daddr_t, etc.

Reported by: bde
2018-04-19 22:43:55 +00:00
mckusick
3e8df1eea5 In addition to the existing argument format:
prtblknos filesystem_device inode ...

add an additional argument format:

	prtblknos file

which is more convenient than figuring out the filesystem
and inode number for "file".

When given a list of multiple inodes, rather than exiting
the program on an error with one of them, skip over it and
continue with the next one.

Submitted by: bde
2018-04-18 23:08:10 +00:00
mckusick
5e674c7664 Check the inode type and only attempt to print block lists for
regular files, directories, and symbolic links that require
external storage.

Correct the handling of files with holes and files that have
one or more large blocks and end with a fragment.

Reported by: bde
2018-04-18 22:24:44 +00:00
mckusick
e9a893e557 Add (intmax_t) type casts to some printf parameters to keep i386 happy. 2018-04-08 07:18:29 +00:00
mckusick
1c8afb9a0e Split tools/diag/prtblknos into two parts:
main.c - opens disk and processes the argument list
		 of inodes to be printed
	prtblknos.c - prints out the list of blocks used by an inode

This change allows the fsdb program to import prtblknos() to use when
printing out the set of blocks used by an inode.

This program was switched to using the libufs library to ease its
integration with fsdb and any other filesystem utility that might
want to use it in the future.
2018-04-08 06:52:58 +00:00
mckusick
a39494df2c Add an explanation of the block size units output by prtblknos.
Suggested by: Ravi Pokala (rpokala@)
2018-02-09 22:23:10 +00:00
mckusick
9ccdf8ab4d This is a little C-program that can be used to print out the list
of blocks used by a requested list of inodes.

For example, to list the blocks referenced by your kernel:

guest_12 % df /
Filesystem      1K-blocks     Used   Avail Capacity  Mounted on
/dev/gpt/rootfs  20307196 10707336 7975288    57%    /

guest_12 % ls -i /boot/kernel/kernel
160603 /boot/kernel/kernel

guest_12 % ./prtblknos /dev/gpt/rootfs 160603
160603:	lbn 0-7 blkno 3217584-3217647
	lbn 8-11 blkno 3217864-3217895 distance 216
First-level indirect, blkno 3217896-3217903 distance 0
	lbn 12-19 blkno 3217904-3217967 distance 8
	lbn 20-75 blkno 3251816-3252263 distance 33848
	lbn 76-83 blkno 3252368-3252431 distance 104
	lbn 84-91 blkno 3252464-3252527 distance 32
	lbn 92-852 blkno 3252896-3258983 distance 368

Each contiguous range of blocks is printed on a line.
The distance metric is the size of the gap from the end of the
previous set of blocks to the beginning of the next set of blocks.
Short distances are desirable.
2018-02-09 19:10:46 +00:00
eadler
4164d23338 diag/httpd-error: remove
This is a script for a web server in a specific
configuration. Current web servers don't produce
similar log files and it isn't FreeBSD's
goal to produce a log file analyzer.
2017-12-02 17:10:13 +00:00
bdrewery
bb97a3d43c Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
imp
c39e6fc2c9 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
eadler
777230d53d Remove scripts and tools which only functioned when src was using CVS
Approved by:	cperciva
MFC after:	1 week
2012-09-13 17:49:11 +00:00
ru
cec60429bb Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
ru
5db2b9d5b3 For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
ru
03d404f837 Fixed ``make checkdpadd''. Removed redundant dependency. 2004-02-05 21:52:33 +00:00
phantom
3ad0860a53 Learn about new world order 2003-11-26 10:43:05 +00:00
ache
b56aac320b Make it works with POSIX sort (POS arg)
All old sorts understand -k too.
2002-09-24 20:05:01 +00:00
des
4d6b787d2d Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
ru
b6743da387 Finish style fixes. 2002-03-26 13:02:15 +00:00
phantom
1fc1e7448f Complete '_' hack. 2002-02-07 19:32:40 +00:00
phantom
acf85e1161 . add a hack dedicated to n_himba (or correctly to say problem with his nick
in docbook environment)
. clarify comments
. mention that this script is dedicated to freefall's environment
. add bsd style copyright
2002-02-07 19:27:29 +00:00
phantom
d47492efbe This script has served its purpose. Now its function is one of subfunctions
of recently added cknames.pl.
2002-02-07 19:13:06 +00:00
phantom
98906825c7 Add script to check integrity between access/authors.ent/passwd@freefall 2002-02-07 19:09:49 +00:00
phantom
0cde3e64eb Fix sentence in comment 2002-02-06 18:00:11 +00:00
phantom
2e5cd0fc0e Update description of 'ac' subdirectory 2002-02-06 17:50:05 +00:00
phantom
87ecf15bb7 Add descirptions of scripts in this directory 2002-02-06 17:49:13 +00:00
phantom
90379737f9 Add script that checks contents of .ent files (sorting and addresses) 2002-02-06 17:47:18 +00:00
phantom
a17a2c3284 List of committers was moved out of handbook. Teach 'ac' about new location.
Also teach it about complex entries in access file (or correctly to say
simplify them)
2002-02-06 17:09:08 +00:00
phantom
742fd635ad * fix some warnings
* set WARNS
* few style/whitespace fixes

Submitted by:	ru
2002-02-04 16:17:19 +00:00
phantom
69dd11200d describe localeck
plus some capitalization/whitespace fixes
2002-02-04 14:00:29 +00:00
phantom
f301c446d8 Add simple diagnostic utility to checking for invalid/incomplete
locales
2002-02-04 13:59:16 +00:00
kbyanc
4138d6fd95 Include definition for struct namecache (it isn't exported via any header)
so this builds again. Replace hardcoded name length magic with NAME_MAX.
2002-01-02 06:25:39 +00:00
ache
4a86803488 ISO_ -> ISO 2001-06-11 01:29:40 +00:00
jake
961b97d434 Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
jake
d93fbc9916 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
sheldonh
eb84051ad9 Correct grammar in the synoptic comment.
Submitted by:	ru
2000-03-03 09:25:00 +00:00
sheldonh
a7cdf0700b Use double-quotes instead of single-quotes when displaying the usage
so that the shell interpolates $0.

PR:		17121
Submitted by:	Peng HaiJie <phj@cn.FreeBSD.org>
2000-03-02 15:00:53 +00:00
wosch
a32554879f Include BSD-license.
PR:		misc/15262
Submitted by:	 alex@big.endian.de
1999-12-06 22:33:40 +00:00
phantom
316924e9e4 Bring ``ac'' into reality. This great tools now works correctly (for
current state of the tree)
1999-11-04 08:45:02 +00:00
phantom
d02421bc71 Add short description of dumpvfscache 1999-11-04 08:42:29 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
wosch
d38151f2d0 httpd-error is a shell script which print a summary about
Web files which does not exists on your host.

E.g.

	httpd-error -userhits < /var/log/httpd-error.log

print the number of errors by users, sorted by error hits.
1998-02-15 18:54:26 +00:00
phk
9a333abb93 A little gadget to dump the contents of the vfs name cache. 1997-09-04 08:28:55 +00:00
wosch
3ad19c4ae3 Add ac which check if the FreeBSD handbook is in sync with the committers list 1997-03-28 14:40:39 +00:00
phk
83b38ce038 README reads:
This directory is for diagnostic programs.

A diagnostic program is one that will inform you that something is wrong
somewhere, for instance by traversing a kernel-structure and verifying
the integrity.

Please make a subdir per program, and add a brief description to this file.
1995-10-15 11:27:15 +00:00