|
|
@ -82,7 +82,7 @@ wprobe_dump_data(struct wprobe_iface *dev) |
|
|
|
bool first = true; |
|
|
|
bool first = true; |
|
|
|
|
|
|
|
|
|
|
|
if (!simple_mode) |
|
|
|
if (!simple_mode) |
|
|
|
fprintf(stderr, "\n"); |
|
|
|
fprintf(stdout, "\n"); |
|
|
|
wprobe_request_data(dev, NULL); |
|
|
|
wprobe_request_data(dev, NULL); |
|
|
|
list_for_each_entry(attr, &dev->global_attr, list) { |
|
|
|
list_for_each_entry(attr, &dev->global_attr, list) { |
|
|
|
if (simple_mode) { |
|
|
|
if (simple_mode) { |
|
|
@ -90,7 +90,7 @@ wprobe_dump_data(struct wprobe_iface *dev) |
|
|
|
fprintf(stdout, "[global]\n"); |
|
|
|
fprintf(stdout, "[global]\n"); |
|
|
|
fprintf(stdout, "%s=%s\n", attr->name, wprobe_dump_value(attr)); |
|
|
|
fprintf(stdout, "%s=%s\n", attr->name, wprobe_dump_value(attr)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
fprintf(stderr, (first ? |
|
|
|
fprintf(stdout, (first ? |
|
|
|
"Global: %s=%s\n" : |
|
|
|
"Global: %s=%s\n" : |
|
|
|
" %s=%s\n"), |
|
|
|
" %s=%s\n"), |
|
|
|
attr->name, |
|
|
|
attr->name, |
|
|
@ -105,7 +105,7 @@ wprobe_dump_data(struct wprobe_iface *dev) |
|
|
|
wprobe_request_data(dev, link->addr); |
|
|
|
wprobe_request_data(dev, link->addr); |
|
|
|
list_for_each_entry(attr, &dev->link_attr, list) { |
|
|
|
list_for_each_entry(attr, &dev->link_attr, list) { |
|
|
|
if (first) { |
|
|
|
if (first) { |
|
|
|
fprintf((simple_mode ? stdout : stderr), |
|
|
|
fprintf(stdout, |
|
|
|
(simple_mode ?
|
|
|
|
(simple_mode ?
|
|
|
|
"[%02x:%02x:%02x:%02x:%02x:%02x]\n%s=%s\n" : |
|
|
|
"[%02x:%02x:%02x:%02x:%02x:%02x]\n%s=%s\n" : |
|
|
|
"%02x:%02x:%02x:%02x:%02x:%02x: %s=%s\n"), |
|
|
|
"%02x:%02x:%02x:%02x:%02x:%02x: %s=%s\n"), |
|
|
@ -115,7 +115,7 @@ wprobe_dump_data(struct wprobe_iface *dev) |
|
|
|
wprobe_dump_value(attr)); |
|
|
|
wprobe_dump_value(attr)); |
|
|
|
first = false; |
|
|
|
first = false; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
fprintf((simple_mode ? stdout : stderr), |
|
|
|
fprintf(stdout, |
|
|
|
(simple_mode ? "%s=%s\n" : |
|
|
|
(simple_mode ? "%s=%s\n" : |
|
|
|
" %s=%s\n"), |
|
|
|
" %s=%s\n"), |
|
|
|
attr->name, |
|
|
|
attr->name, |
|
|
@ -171,11 +171,11 @@ static void show_attributes(struct wprobe_iface *dev) |
|
|
|
if (simple_mode) |
|
|
|
if (simple_mode) |
|
|
|
return; |
|
|
|
return; |
|
|
|
list_for_each_entry(attr, &dev->global_attr, list) { |
|
|
|
list_for_each_entry(attr, &dev->global_attr, list) { |
|
|
|
fprintf(stderr, "Global attribute: '%s' (%s)\n", |
|
|
|
fprintf(stdout, "Global attribute: '%s' (%s)\n", |
|
|
|
attr->name, attr_typestr[attr->type]); |
|
|
|
attr->name, attr_typestr[attr->type]); |
|
|
|
} |
|
|
|
} |
|
|
|
list_for_each_entry(attr, &dev->link_attr, list) { |
|
|
|
list_for_each_entry(attr, &dev->link_attr, list) { |
|
|
|
fprintf(stderr, "Link attribute: '%s' (%s)\n", |
|
|
|
fprintf(stdout, "Link attribute: '%s' (%s)\n", |
|
|
|
attr->name, attr_typestr[attr->type]); |
|
|
|
attr->name, attr_typestr[attr->type]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -196,9 +196,9 @@ static void show_filter_simple(void *arg, const char *group, struct wprobe_filte |
|
|
|
static void show_filter(void *arg, const char *group, struct wprobe_filter_item *items, int n_items) |
|
|
|
static void show_filter(void *arg, const char *group, struct wprobe_filter_item *items, int n_items) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
fprintf(stderr, "Filter group: '%s' (tx/rx)\n", group); |
|
|
|
fprintf(stdout, "Filter group: '%s' (tx/rx)\n", group); |
|
|
|
for (i = 0; i < n_items; i++) { |
|
|
|
for (i = 0; i < n_items; i++) { |
|
|
|
fprintf(stderr, " - %s (%lld/%lld)\n", |
|
|
|
fprintf(stdout, " - %s (%lld/%lld)\n", |
|
|
|
items[i].name, items[i].tx, items[i].rx); |
|
|
|
items[i].name, items[i].tx, items[i].rx); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -415,7 +415,7 @@ int main(int argc, char **argv) |
|
|
|
if (!dev || (list_empty(&dev->global_attr) && |
|
|
|
if (!dev || (list_empty(&dev->global_attr) && |
|
|
|
list_empty(&dev->link_attr))) { |
|
|
|
list_empty(&dev->link_attr))) { |
|
|
|
if (err) |
|
|
|
if (err) |
|
|
|
fprintf(stderr, "%s\n", err); |
|
|
|
fprintf(stdout, "%s\n", err); |
|
|
|
else |
|
|
|
else |
|
|
|
fprintf(stderr, "Interface '%s' not found\n", ifname); |
|
|
|
fprintf(stderr, "Interface '%s' not found\n", ifname); |
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|