X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=a822071400c84938a3b7c19b68f3f8cb09f626a7;hb=4466912fc280873b6432973b287a48bf9c959b6c;hp=62816cecb89f4423970db66177e7821d025983a1;hpb=f7e1a95010435d8a7fdc4fe7e94dc63adbd631d0;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 62816cecb..a82207140 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -2538,3 +2538,46 @@ error: rcu_read_unlock(); return -1; } + +/* + * Calibrate registered applications. + */ +int ust_app_calibrate_glb(struct lttng_ust_calibrate *calibrate) +{ + int ret = 0; + struct lttng_ht_iter iter; + struct ust_app *app; + + rcu_read_lock(); + + cds_lfht_for_each_entry(ust_app_ht->ht, &iter.iter, app, node.node) { + if (!app->compatible) { + /* + * TODO: In time, we should notice the caller of this error by + * telling him that this is a version error. + */ + continue; + } + + ret = ustctl_calibrate(app->key.sock, calibrate); + if (ret < 0) { + switch (ret) { + case -ENOSYS: + /* Means that it's not implemented on the tracer side. */ + ret = 0; + break; + default: + /* TODO: Report error to user */ + DBG2("Calibrate app PID %d returned with error %d", + app->key.pid, ret); + break; + } + } + } + + DBG("UST app global domain calibration finished"); + + rcu_read_unlock(); + + return ret; +}