char buf[512];
size_t size = sizeof(buf);
- if (symbol_conf.event_group && evsel->nr_members > 1) {
+ if (perf_evsel__is_group_event(evsel)) {
struct perf_evsel *pos;
perf_evsel__group_desc(evsel, buf, size);
char buf[512];
size_t buflen = sizeof(buf);
- if (symbol_conf.event_group && evsel->nr_members > 1) {
+ if (perf_evsel__is_group_event(evsel)) {
struct perf_evsel *pos;
perf_evsel__group_desc(evsel, buf, buflen);
ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED :
HE_COLORSET_NORMAL);
- if (symbol_conf.event_group && evsel->nr_members > 1) {
+ if (perf_evsel__is_group_event(evsel)) {
struct perf_evsel *pos;
ev_name = perf_evsel__group_name(evsel);
int ret;
double percent = 0.0;
struct hists *hists = he->hists;
+ struct perf_evsel *evsel = hists_to_evsel(hists);
if (hists->stats.total_period)
percent = 100.0 * get_field(he) / hists->stats.total_period;
ret = __percent_color_snprintf(hpp->buf, hpp->size, percent);
- if (symbol_conf.event_group) {
+ if (perf_evsel__is_group_event(evsel)) {
int prev_idx, idx_delta;
- struct perf_evsel *evsel = hists_to_evsel(hists);
struct hist_entry *pair;
int nr_members = evsel->nr_members;
- if (nr_members <= 1)
- return ret;
-
prev_idx = perf_evsel__group_idx(evsel);
list_for_each_entry(pair, &he->pairs.head, pairs.node) {
{
int ret;
struct hists *hists = he->hists;
+ struct perf_evsel *evsel = hists_to_evsel(hists);
if (fmt_percent) {
double percent = 0.0;
} else
ret = print_fn(hpp->buf, hpp->size, fmt, get_field(he));
- if (symbol_conf.event_group) {
+ if (perf_evsel__is_group_event(evsel)) {
int prev_idx, idx_delta;
- struct perf_evsel *evsel = hists_to_evsel(hists);
struct hist_entry *pair;
int nr_members = evsel->nr_members;
- if (nr_members <= 1)
- return ret;
-
prev_idx = perf_evsel__group_idx(evsel);
list_for_each_entry(pair, &he->pairs.head, pairs.node) {
next = disasm__get_next_ip_line(¬es->src->source, dl);
- if (symbol_conf.event_group &&
- perf_evsel__is_group_leader(evsel) &&
- evsel->nr_members > 1) {
+ if (perf_evsel__is_group_event(evsel)) {
nr_percent = evsel->nr_members;
ppercents = calloc(nr_percent, sizeof(double));
if (ppercents == NULL)
if (queue)
return -1;
- if (symbol_conf.event_group &&
- perf_evsel__is_group_leader(evsel))
+ if (perf_evsel__is_group_event(evsel))
width *= evsel->nr_members;
if (!*dl->line)
len = symbol__size(sym);
namelen = strlen(d_filename);
- if (symbol_conf.event_group && perf_evsel__is_group_leader(evsel))
+ if (perf_evsel__is_group_event(evsel))
width *= evsel->nr_members;
printf(" %-*.*s| Source code & Disassembly of %s\n",
#include "xyarray.h"
#include "cgroup.h"
#include "hist.h"
+#include "symbol.h"
struct perf_counts_values {
union {
return list_entry(evsel->node.next, struct perf_evsel, node);
}
+/**
+ * perf_evsel__is_group_leader - Return whether given evsel is a leader event
+ *
+ * @evsel - evsel selector to be tested
+ *
+ * Return %true if @evsel is a group leader or a stand-alone event
+ */
static inline bool perf_evsel__is_group_leader(const struct perf_evsel *evsel)
{
return evsel->leader == evsel;
}
+/**
+ * perf_evsel__is_group_event - Return whether given evsel is a group event
+ *
+ * @evsel - evsel selector to be tested
+ *
+ * Return %true iff event group view is enabled and @evsel is a actual group
+ * leader which has other members in the group
+ */
+static inline bool perf_evsel__is_group_event(struct perf_evsel *evsel)
+{
+ if (!symbol_conf.event_group)
+ return false;
+
+ return perf_evsel__is_group_leader(evsel) && evsel->nr_members > 1;
+}
+
struct perf_attr_details {
bool freq;
bool verbose;