*
* LTTng filter bytecode generation
*
- * Copyright 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * Copyright 2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License, version 2.1 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: LGPL-2.1-only
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
}
ret = bytecode_push(&ctx->bytecode_reloc, symbol,
1, strlen(symbol) + 1);
+ if (ret) {
+ goto end;
+ }
ret = 1; /* legacy */
end:
free(insn);
return -EINVAL;
}
+ /*
+ * TODO: if we remove legacy load for application contexts, we
+ * need to update session bytecode parser as well.
+ */
ret = visit_node_load_expression_legacy(ctx, exp, op);
if (ret < 0) {
return ret;
case AST_UNARY_NOT:
insn.op = FILTER_OP_UNARY_NOT;
return bytecode_push(&ctx->bytecode, &insn, 1, sizeof(insn));
+ case AST_UNARY_BIT_NOT:
+ insn.op = FILTER_OP_UNARY_BIT_NOT;
+ return bytecode_push(&ctx->bytecode, &insn, 1, sizeof(insn));
}
}
case AST_OP_MINUS:
insn.op = FILTER_OP_MINUS;
break;
- case AST_OP_RSHIFT:
- insn.op = FILTER_OP_RSHIFT;
+ case AST_OP_BIT_RSHIFT:
+ insn.op = FILTER_OP_BIT_RSHIFT;
break;
- case AST_OP_LSHIFT:
- insn.op = FILTER_OP_LSHIFT;
+ case AST_OP_BIT_LSHIFT:
+ insn.op = FILTER_OP_BIT_LSHIFT;
break;
case AST_OP_BIT_AND:
insn.op = FILTER_OP_BIT_AND;