|
@@ -28,11 +28,16 @@
|
|
#include "event-utils.h"
|
|
#include "event-utils.h"
|
|
|
|
|
|
#define COMM "COMM"
|
|
#define COMM "COMM"
|
|
|
|
+#define CPU "CPU"
|
|
|
|
|
|
static struct format_field comm = {
|
|
static struct format_field comm = {
|
|
.name = "COMM",
|
|
.name = "COMM",
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+static struct format_field cpu = {
|
|
|
|
+ .name = "CPU",
|
|
|
|
+};
|
|
|
|
+
|
|
struct event_list {
|
|
struct event_list {
|
|
struct event_list *next;
|
|
struct event_list *next;
|
|
struct event_format *event;
|
|
struct event_format *event;
|
|
@@ -382,14 +387,17 @@ create_arg_item(struct event_format *event, const char *token,
|
|
/* Consider this a field */
|
|
/* Consider this a field */
|
|
field = pevent_find_any_field(event, token);
|
|
field = pevent_find_any_field(event, token);
|
|
if (!field) {
|
|
if (!field) {
|
|
- if (strcmp(token, COMM) != 0) {
|
|
|
|
|
|
+ /* If token is 'COMM' or 'CPU' then it is special */
|
|
|
|
+ if (strcmp(token, COMM) == 0) {
|
|
|
|
+ field = &comm;
|
|
|
|
+ } else if (strcmp(token, CPU) == 0) {
|
|
|
|
+ field = &cpu;
|
|
|
|
+ } else {
|
|
/* not a field, Make it false */
|
|
/* not a field, Make it false */
|
|
arg->type = FILTER_ARG_BOOLEAN;
|
|
arg->type = FILTER_ARG_BOOLEAN;
|
|
arg->boolean.value = FILTER_FALSE;
|
|
arg->boolean.value = FILTER_FALSE;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- /* If token is 'COMM' then it is special */
|
|
|
|
- field = &comm;
|
|
|
|
}
|
|
}
|
|
arg->type = FILTER_ARG_FIELD;
|
|
arg->type = FILTER_ARG_FIELD;
|
|
arg->field.field = field;
|
|
arg->field.field = field;
|
|
@@ -1718,6 +1726,10 @@ get_value(struct event_format *event,
|
|
return (unsigned long)name;
|
|
return (unsigned long)name;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* Handle our dummy "cpu" field */
|
|
|
|
+ if (field == &cpu)
|
|
|
|
+ return record->cpu;
|
|
|
|
+
|
|
pevent_read_number_field(field, record->data, &val);
|
|
pevent_read_number_field(field, record->data, &val);
|
|
|
|
|
|
if (!(field->flags & FIELD_IS_SIGNED))
|
|
if (!(field->flags & FIELD_IS_SIGNED))
|