X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng-sessiond%2Fust-app.c;h=e1d11cfbccabfed425a6400a71d34e1dbb4935af;hp=35688702602eb4fd5d91b9825da95dc4acaf81fd;hb=0df502fd9da4e1895e1f3719afc51c8edd710c9e;hpb=84cd17c63cde7ea5d7a0ad037dd41e8297658812 diff --git a/lttng-sessiond/ust-app.c b/lttng-sessiond/ust-app.c index 356887026..e1d11cfbc 100644 --- a/lttng-sessiond/ust-app.c +++ b/lttng-sessiond/ust-app.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -827,12 +828,27 @@ error: * Using pid and uid (of the app), allocate a new ust_app struct and * add it to the global traceable app list. * - * On success, return 0, else return malloc ENOMEM. + * On success, return 0, else return malloc -ENOMEM, or -EINVAL if app + * bitness is not supported. */ int ust_app_register(struct ust_register_msg *msg, int sock) { struct ust_app *lta; + /* + * Currently support only tracing of application which share the + * same bitness as the consumer. Eventually implement dispatch + * to specific compat32 consumer. + */ + if (msg->bits_per_long != CAA_BITS_PER_LONG) { + ERR("Registration failed: application %s (pid: %d) has " + "%d-bit long, but only " + "%d-bit lttng-consumerd is available.\n", + msg->name, msg->pid, msg->bits_per_long, + CAA_BITS_PER_LONG); + return -EINVAL; + } + lta = zmalloc(sizeof(struct ust_app)); if (lta == NULL) { PERROR("malloc");