+struct sym_priv {
+ struct sym_hist *hist;
+ struct sym_ext *ext;
+};
+
+static struct symbol_conf symbol_conf = {
+ .priv_size = sizeof(struct sym_priv),
+ .try_vmlinux_path = true,
+};
+
+static const char *sym_hist_filter;
+
+static int symbol_filter(struct map *map __used, struct symbol *sym)
+{
+ if (sym_hist_filter == NULL ||
+ strcmp(sym->name, sym_hist_filter) == 0) {
+ struct sym_priv *priv = symbol__priv(sym);
+ const int size = (sizeof(*priv->hist) +
+ (sym->end - sym->start) * sizeof(u64));
+
+ priv->hist = malloc(size);
+ if (priv->hist)
+ memset(priv->hist, 0, size);
+ return 0;
+ }
+ /*
+ * FIXME: We should really filter it out, as we don't want to go thru symbols
+ * we're not interested, and if a DSO ends up with no symbols, delete it too,
+ * but right now the kernel loading routines in symbol.c bail out if no symbols
+ * are found, fix it later.
+ */
+ return 0;
+}