ctx->num_enabled_probes = 0;
for (l = o->device->probes; l; l = l->next) {
probe = l->data;
- if (probe->enabled)
- ctx->probelist[ctx->num_enabled_probes++] = probe->name;
+ if (!probe->enabled)
+ continue;
+ ctx->probelist[ctx->num_enabled_probes++] = probe->name;
}
ctx->probelist[ctx->num_enabled_probes] = 0;
{
struct context *ctx;
unsigned int i, outsize, p, curbit;
- uint64_t sample, count = 0;
+ uint64_t sample;
+ static uint64_t samplecount = 0;
char *outbuf, *c;
ctx = o->internal;
/* The first column is a counter (needed for gnuplot). */
c = outbuf + strlen(outbuf);
- sprintf(c, "%" PRIu64 "\t\t", count++);
+ sprintf(c, "%" PRIu64 "\t\t", samplecount++);
/* The next columns are the values of all channels. */
for (p = 0; p < ctx->num_enabled_probes; p++) {
- curbit = (sample & ((uint64_t) (1 << p))) != 0;
+ curbit = (sample & ((uint64_t) (1 << p))) >> p;
c = outbuf + strlen(outbuf);
sprintf(c, "%d ", curbit);
}