ret = lttng_set_event_filter(handle, ev.name, channel_name,
opt_filter);
if (ret < 0) {
- ERR("Error setting filter");
+ switch (-ret) {
+ case LTTNG_ERR_FILTER_EXIST:
+ ERR("Filter on events is already enabled"
+ " (channel %s, session %s)",
+ channel_name, session_name);
+ break;
+ default:
+ ERR("Error setting filter");
+ break;
+ }
+
ret = -1;
goto error;
}
ret = lttng_set_event_filter(handle, ev.name,
channel_name, opt_filter);
if (ret < 0) {
- ERR("Error setting filter");
+ switch (-ret) {
+ case LTTNG_ERR_FILTER_EXIST:
+ ERR("Filter on event %s is already enabled"
+ " (channel %s, session %s)",
+ event_name, channel_name, session_name);
+ break;
+ default:
+ ERR("Error setting filter");
+ break;
+ }
+
ret = -1;
goto error;
}