svn commit: r192797 - head/sys/geom

Pawel Jakub Dawidek pjd at FreeBSD.org
Tue May 26 09:02:17 UTC 2009


On Tue, May 26, 2009 at 07:29:18AM +0000, Ulf Lilleengen wrote:
> Author: lulf
> Date: Tue May 26 07:29:17 2009
> New Revision: 192797
> URL: http://svn.freebsd.org/changeset/base/192797
> 
> Log:
>   - Add 'show bio' DDB command.
>   
>   MFC after:	3 weeks
> 
> Modified:
>   head/sys/geom/geom_subr.c
[...]
> +static void
> +db_print_bio_flags(struct bio *bp)
> +{
> +	int comma;
> +
> +	comma = 0;
> +	printf("  flags: ");
> +	if (bp->bio_flags & BIO_ERROR) {
> +		printf("BIO_ERROR");
> +		comma = 1;
> +	}
> +	if (bp->bio_flags & BIO_DONE) {
> +		printf("%sBIO_ERROR", (comma ? ", " : ""));

I think you wanted BIO_DONE here.

> +/*
> + * Print useful information in a BIO
> + */
> +DB_SHOW_COMMAND(bio, db_show_bio)
> +{
> +	struct bio *bp;
> +
> +	if (have_addr) {
> +		bp = (struct bio *)addr;
> +		printf("BIO %p\n", bp);
> +		db_print_bio_cmd(bp);
> +		db_print_bio_flags(bp);
> +		printf("  cflags: 0x%hhx\n", bp->bio_cflags);
> +		printf("  pflags: 0x%hhx\n", bp->bio_pflags);
> +		printf("  offset: %lld\n", bp->bio_offset);
> +		printf("  length: %lld\n", bp->bio_length);
> +		printf("  bcount: %ld\n", bp->bio_bcount);
> +		printf("  resid: %ld\n", bp->bio_resid);
> +		printf("  completed: %lld\n", bp->bio_completed);
> +		printf("  children: %u\n", bp->bio_children);
> +		printf("  inbed: %u\n", bp->bio_inbed);
> +		printf("  error: %d\n", bp->bio_error);
> +		printf("  parent: %p\n", bp->bio_parent);
> +		printf("  driver1: %p\n", bp->bio_driver1);
> +		printf("  driver2: %p\n", bp->bio_driver2);
> +		printf("  caller1: %p\n", bp->bio_caller1);
> +		printf("  caller2: %p\n", bp->bio_caller2);
> +		printf("  bio_from: %p\n", bp->bio_from);
> +		printf("  bio_to: %p\n", bp->bio_to);
> +	}
> +}

In DDB functions you should use db_printf() instead of printf().

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd at FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090526/06429312/attachment.pgp


More information about the svn-src-all mailing list