blob: e2be430e64e819026f44bfb8bfb190da4fbcb385 [file] [log] [blame]
Amit Aroraed3e5652010-10-27 12:02:53 +05301/*******************************************************************************
Amit Kucheriac0e17fc2011-01-17 09:35:52 +02002 * Copyright (C) 2010, Linaro Limited.
Amit Aroraed3e5652010-10-27 12:02:53 +05303 *
4 * This file is part of PowerDebug.
5 *
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors:
12 * Amit Arora <amit.arora@linaro.org> (IBM Corporation)
13 * - initial API and implementation
14 *******************************************************************************/
15
16#include <sys/stat.h>
17#include <sys/vfs.h>
Amit Aroraac4e8652010-11-09 11:16:53 +053018#include <errno.h>
19#include <sys/stat.h>
Amit Aroraed3e5652010-10-27 12:02:53 +053020#include <linux/magic.h>
21
Amit Arora3bc8c922010-11-16 11:27:38 +053022extern int maxy;
Amit Arora81350772010-11-16 14:56:26 +053023extern int dump;
Amit Arora3bc8c922010-11-16 11:27:38 +053024
Amit Arora04f97742010-11-16 11:28:57 +053025#define MAX_LINES 120
Amit Arora031263a2010-11-09 11:12:41 +053026
Amit Aroraed3e5652010-10-27 12:02:53 +053027struct clock_info {
Amit Arora6e774cd2010-10-28 11:31:24 +053028 char name[NAME_MAX];
29 int flags;
30 int rate;
31 int usecount;
32 int num_children;
33 int last_child;
Amit Arora031263a2010-11-09 11:12:41 +053034 int expanded;
Amit Aroraac4e8652010-11-09 11:16:53 +053035 int level;
Amit Arora6e774cd2010-10-28 11:31:24 +053036 struct clock_info *parent;
37 struct clock_info **children;
Amit Aroraed3e5652010-10-27 12:02:53 +053038} *clocks_info;
39
40char debugfs_mntpoint[1024];
Amit Arora031263a2010-11-09 11:12:41 +053041char clock_lines[MAX_LINES][128];
42int clock_line_no;
Amit Aroraac4e8652010-11-09 11:16:53 +053043int old_clock_line_no;
Amit Aroraed3e5652010-10-27 12:02:53 +053044
45char *likely_mpoints[] = {
Amit Arora6e774cd2010-10-28 11:31:24 +053046 "/sys/kernel/debug",
47 "/debug",
48 NULL
Amit Aroraed3e5652010-10-27 12:02:53 +053049};
Amit Arora031263a2010-11-09 11:12:41 +053050
Amit Aroraac4e8652010-11-09 11:16:53 +053051void add_clock_details_recur(struct clock_info *clk, int hrow, int selected);
Amit Arora031263a2010-11-09 11:12:41 +053052void destroy_clocks_info(void);
53void destroy_clocks_info_recur(struct clock_info *clock);
Amit Aroraac4e8652010-11-09 11:16:53 +053054void collapse_all_subclocks(struct clock_info *clock);
Amit Aroraf4fb8102010-11-30 13:55:50 +053055void dump_all_parents(char *clkarg);
56struct clock_info *find_clock(struct clock_info *clk, char *clkarg);