tools/perf/ui/gtk/hists.c
Source file repositories/reference/linux-study-clean/tools/perf/ui/gtk/hists.c
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/ui/gtk/hists.c- Extension
.c- Size
- 17405 bytes
- Lines
- 682
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
gtk.h../evlist.h../callchain.h../evsel.h../sort.h../hist.h../helpline.h../string2.hsignal.hstdlib.hlinux/string.h
Detected Declarations
function __percent_color_snprintffunction perf_gtk__init_hppfunction perf_gtk__add_callchain_flatfunction list_for_each_entryfunction list_for_each_entryfunction perf_gtk__add_callchain_foldedfunction list_for_each_entryfunction list_for_each_entryfunction perf_gtk__add_callchain_graphfunction list_for_each_entryfunction perf_gtk__add_callchainfunction on_row_activatedfunction perf_gtk__show_histsfunction hists__for_each_formatfunction hists__for_each_formatfunction perf_gtk__add_hierarchy_entriesfunction perf_hpp_list__for_each_formatfunction perf_hpp_list__for_each_formatfunction perf_gtk__show_hierarchyfunction hists__for_each_formatfunction perf_hpp_list__for_each_formatfunction evlist__gtk_browse_histsfunction evlist__for_each_entry
Annotated Snippet
list_for_each_entry(chain, &node->parent_val, list) {
char buf[128];
gtk_tree_store_append(store, &iter, &new_parent);
callchain_node__scnprintf_value(node, buf, sizeof(buf), total);
gtk_tree_store_set(store, &iter, 0, buf, -1);
callchain_list__sym_name(chain, buf, sizeof(buf), false);
gtk_tree_store_set(store, &iter, col, buf, -1);
if (need_new_parent) {
/*
* Only show the top-most symbol in a callchain
* if it's not the only callchain.
*/
new_parent = iter;
need_new_parent = false;
}
}
list_for_each_entry(chain, &node->val, list) {
char buf[128];
gtk_tree_store_append(store, &iter, &new_parent);
callchain_node__scnprintf_value(node, buf, sizeof(buf), total);
gtk_tree_store_set(store, &iter, 0, buf, -1);
callchain_list__sym_name(chain, buf, sizeof(buf), false);
gtk_tree_store_set(store, &iter, col, buf, -1);
if (need_new_parent) {
/*
* Only show the top-most symbol in a callchain
* if it's not the only callchain.
*/
new_parent = iter;
need_new_parent = false;
}
}
}
}
static void perf_gtk__add_callchain_folded(struct rb_root *root, GtkTreeStore *store,
GtkTreeIter *parent, int col, u64 total)
{
struct rb_node *nd;
for (nd = rb_first(root); nd; nd = rb_next(nd)) {
struct callchain_node *node;
struct callchain_list *chain;
GtkTreeIter iter;
char buf[64];
char *str, *str_alloc = NULL;
bool first = true;
node = rb_entry(nd, struct callchain_node, rb_node);
callchain_node__make_parent_list(node);
list_for_each_entry(chain, &node->parent_val, list) {
char name[1024];
callchain_list__sym_name(chain, name, sizeof(name), false);
if (asprintf(&str, "%s%s%s",
first ? "" : str_alloc,
first ? "" : symbol_conf.field_sep ?: "; ",
name) < 0)
return;
first = false;
free(str_alloc);
str_alloc = str;
}
list_for_each_entry(chain, &node->val, list) {
char name[1024];
callchain_list__sym_name(chain, name, sizeof(name), false);
if (asprintf(&str, "%s%s%s",
first ? "" : str_alloc,
first ? "" : symbol_conf.field_sep ?: "; ",
name) < 0)
return;
first = false;
free(str_alloc);
Annotation
- Immediate include surface: `gtk.h`, `../evlist.h`, `../callchain.h`, `../evsel.h`, `../sort.h`, `../hist.h`, `../helpline.h`, `../string2.h`.
- Detected declarations: `function __percent_color_snprintf`, `function perf_gtk__init_hpp`, `function perf_gtk__add_callchain_flat`, `function list_for_each_entry`, `function list_for_each_entry`, `function perf_gtk__add_callchain_folded`, `function list_for_each_entry`, `function list_for_each_entry`, `function perf_gtk__add_callchain_graph`, `function list_for_each_entry`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.