Index: g_journal.c =================================================================== RCS file: /zoo/cvsup/FreeBSD-CVS/src/sys/geom/journal/g_journal.c,v retrieving revision 1.9 diff -u -p -r1.9 g_journal.c --- g_journal.c 2 Dec 2006 09:10:29 -0000 1.9 +++ g_journal.c 17 Feb 2007 00:45:13 -0000 @@ -210,6 +210,13 @@ SYSCTL_ULONG(_kern_geom_journal_stats, O SYSCTL_ULONG(_kern_geom_journal_stats, OID_AUTO, low_mem, CTLFLAG_RW, &g_journal_stats_low_mem, 0, "Number of times low_mem hook was called."); +static time_t g_journal_switch_seconds_last = 0; +static time_t g_journal_switch_seconds = 0; +static u_long g_journal_data_provider_total = 0; +static u_long g_journal_data_provider_total_last = 0; +static u_long g_journal_journal_provider_total = 0; +static u_long g_journal_journal_provider_total_last = 0; + static g_taste_t g_journal_taste; static g_ctl_req_t g_journal_config; static g_dumpconf_t g_journal_dumpconf; @@ -339,6 +346,12 @@ g_journal_check_overflow(struct g_journa (sc->sc_active.jj_offset > sc->sc_inactive.jj_offset && sc->sc_journal_offset >= sc->sc_inactive.jj_offset && sc->sc_journal_offset < sc->sc_active.jj_offset)) { + printf("Switch time: current-last = %jus\n", (uintmax_t)(time_second - g_journal_switch_seconds); + printf("Switch time: last-previous = %jus\n", (uintmax_t)(g_journal_switch_seconds - g_journal_switch_seconds_last); + printf("Data provider: current = %lub\n", g_journal_data_provider_total); + printf("Data provider: last = %lub\n", g_journal_data_provider_total_last); + printf("Journal provider: current = %lub\n", g_journal_journal_provider_total); + printf("Journal provider: last = %lub\n", g_journal_journal_provider_total_last); panic("Journal overflow (joffset=%jd active=%jd inactive=%jd)", (intmax_t)sc->sc_journal_offset, (intmax_t)sc->sc_active.jj_offset, @@ -1129,6 +1142,7 @@ g_journal_copy_send(struct g_journal_sof else { bp->bio_joffset = 0; GJ_LOGREQ(4, bp, "SEND"); + g_journal_data_provider_total += bp->bio_length; g_io_request(bp, sc->sc_dconsumer); } } @@ -1395,6 +1409,7 @@ g_journal_flush_send(struct g_journal_so while ((bp = GJQ_FIRST(bioq)) != NULL) { GJQ_REMOVE(bioq, bp); GJ_LOGREQ(3, bp, "Flush request send"); + g_journal_journal_provider_total += bp->bio_length; g_io_request(bp, cp); } } @@ -1725,6 +1740,13 @@ g_journal_switch(struct g_journal_softc sc->sc_journal_offset - pp->sectorsize; sc->sc_active.jj_queue = NULL; + g_journal_switch_seconds_last = g_journal_switch_seconds; + g_journal_switch_seconds = time_second; + g_journal_data_provider_total_last = g_journal_data_provider_total; + g_journal_data_provider_total = 0; + g_journal_journal_provider_total_last = g_journal_journal_provider_total; + g_journal_journal_provider_total = 0; + /* * Switch is done, start copying data from the (now) inactive * journal to the data provider.