search for: tvdiff_usec

Displaying 11 results from an estimated 11 matches for "tvdiff_usec".

2019 Sep 28
0
[PATCH nbdkit v2 1/4] common/include: Add function for subtracting struct timeval.
...e <assert.h> #include <sys/time.h> #include "tvdiff.h" @@ -45,37 +44,87 @@ * implementation. */ +#define TEST_TVDIFF(tv1, tv2, expected) \ + do { \ + int64_t actual = tvdiff_usec (&(tv1), &(tv2)); \ + \ + if (actual != (expected)) { \ + fprintf (stderr, \ + "%s:...
2020 Oct 17
0
[PATCH nbdkit] common/include/tvdiff.h: Add formal specification.
This commit adds a formal specification of tvdiff_usec and a partial specification of subtract_timeval. These may be proved using Frama-C. The existing functions ignored overflow, but it is possible to call the functions with parameters that will cause overflow. So to create a formal specification I had to modify the functions to signal overflow. L...
2019 Sep 28
2
[PATCH nbdkit 1/2] common/include: Add function for subtracting struct timeval.
...e <assert.h> #include <sys/time.h> #include "tvdiff.h" @@ -45,37 +44,87 @@ * implementation. */ +#define TEST_TVDIFF(tv1, tv2, expected) \ + do { \ + int64_t actual = tvdiff_usec (&(tv1), &(tv2)); \ + \ + if (actual != (expected)) { \ + fprintf (stderr, \ + "%s:...
2019 Nov 30
0
[PATCH nbdkit 2/3] filters: stats: Measure time per operation
..._t count, uint64_t offset, uint32_t flags, int *err) { + struct timeval start, end; + int64_t usecs; int r; + gettimeofday (&start, NULL); r = next_ops->pread (nxdata, buf, count, offset, flags, err); if (r == 0) { + gettimeofday (&end, NULL); + usecs = tvdiff_usec(&start, &end); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); pread_ops++; pread_bytes += count; + pread_usecs += usecs; } return r; } @@ -204,13 +211,20 @@ stats_pwrite (struct nbdkit_next_ops *next_ops, void *nxdata, const void *buf, uint32_t count,...
2019 Sep 28
9
[PATCH nbdkit v2 0/4] info: Add mode for sending back server time.
v1 was: https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00361 v2: - Adds a patch to rename the reflection plugin to the info plugin. - Adds tests. Rich.
2019 Sep 30
1
Re: [PATCH nbdkit v2 1/4] common/include: Add function for subtracting struct timeval.
...t argc, char *argv[]) Not sure this part matters, but doesn't hurt either. > +++ b/common/include/tvdiff.h > @@ -40,7 +40,7 @@ > #include <sys/time.h> > > /* Return the number of µs (microseconds) in y - x. */ > -static int64_t > +static inline int64_t > tvdiff_usec (const struct timeval *x, const struct timeval *y) > { > int64_t usec; > @@ -50,4 +50,15 @@ tvdiff_usec (const struct timeval *x, const struct timeval *y) > return usec; > } > > +/* Return timeval difference as another struct timeval. z = y - x. */ > +static i...
2019 Nov 30
5
[PATCH nbdkit 0/3] filters: stats: More useful, more friendly
- Use more friendly output with GiB and MiB/s. - Measure time per operation, providing finer grain stats - Add missing stats for flush I hope that these changes will help to understand and imporve virt-v2v performance. Nir Soffer (3): filters: stats: Show size in GiB, rate in MiB/s filters: stats: Measure time per operation filters: stats: Add flush stats filters/stats/stats.c | 117
2019 Nov 30
0
[PATCH nbdkit v2 2/3] filters: stats: Measure time per operation
..."statsappend=<BOOL> True to append to the log (default false).\n" static inline void -record_stat (stat *st, uint32_t count) +record_stat (stat *st, uint32_t count, struct timeval *start) { + struct timeval end; + uint64_t usecs; + + gettimeofday(&end, NULL); + usecs = tvdiff_usec(start, &end); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); st->ops++; st->bytes += count; + st->usecs += usecs; } /* Read. */ @@ -200,10 +222,12 @@ stats_pread (struct nbdkit_next_ops *next_ops, void *nxdata, void *handle, void *buf, uint32_t count, uint64_...
2019 Apr 24
0
[nbdkit PATCH 4/4] filters: Check for mutex failures
...); size = r; - pthread_mutex_unlock (&lock); return r; } diff --git a/filters/stats/stats.c b/filters/stats/stats.c index 96de154..7cbf129 100644 --- a/filters/stats/stats.c +++ b/filters/stats/stats.c @@ -100,9 +100,8 @@ stats_unload (void) gettimeofday (&now, NULL); usecs = tvdiff_usec (&start_t, &now); if (fp && usecs > 0) { - pthread_mutex_lock (&lock); + ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock); print_stats (usecs); - pthread_mutex_unlock (&lock); } if (fp) @@ -163,10 +162,9 @@ stats_pread (struct nbdkit_next_ops *next_ops,...
2019 Nov 30
4
[PATCH nbdkit v2 0/3] filters: stats: More useful, more friendly
- Use more friendly output with GiB and MiB/s - Measure time per operation, providing finer grain stats - Add total stats for understanding system throughput - Add missing stats for flush I hope that these changes will help to understand and improve virt-v2v performance. Changes since v1: - Keep bytes values - Increase precision to 0.001 GiB and 0.001 MiB/s - Add total stats - Show time before
2019 Apr 24
7
[nbdkit PATCH 0/4] More mutex sanity checking
I do have a question about whether patch 2 is right, or whether I've exposed a bigger problem in the truncate (and possibly other) filter, but the rest seem fairly straightforward. Eric Blake (4): server: Check for pthread lock failures truncate: Factor out reading real_size under mutex plugins: Check for mutex failures filters: Check for mutex failures filters/cache/cache.c