blob: 87e7139ba50c3b5ec3ec6bce30fe53e77f538827 [file] [log] [blame]
Amit Aroraed3e5652010-10-27 12:02:53 +05301/*******************************************************************************
2 * Copyright (C) 2010, Linaro
3 * Copyright (C) 2010, IBM Corporation
4 *
5 * This file is part of PowerDebug.
6 *
7 * All rights reserved. This program and the accompanying materials
8 * are made available under the terms of the Eclipse Public License v1.0
9 * which accompanies this distribution, and is available at
10 * http://www.eclipse.org/legal/epl-v10.html
11 *
12 * Contributors:
13 * Amit Arora <amit.arora@linaro.org> (IBM Corporation)
14 * - initial API and implementation
15 *******************************************************************************/
16
17#include <sys/stat.h>
18#include <sys/vfs.h>
19#include <linux/magic.h>
20
Amit Arora031263a2010-11-09 11:12:41 +053021#define MAX_LINES 80
22
Amit Aroraed3e5652010-10-27 12:02:53 +053023struct clock_info {
Amit Arora6e774cd2010-10-28 11:31:24 +053024 char name[NAME_MAX];
25 int flags;
26 int rate;
27 int usecount;
28 int num_children;
29 int last_child;
Amit Arora031263a2010-11-09 11:12:41 +053030 int expanded;
Amit Arora6e774cd2010-10-28 11:31:24 +053031 struct clock_info *parent;
32 struct clock_info **children;
Amit Aroraed3e5652010-10-27 12:02:53 +053033} *clocks_info;
34
35char debugfs_mntpoint[1024];
Amit Arora031263a2010-11-09 11:12:41 +053036char clock_lines[MAX_LINES][128];
37int clock_line_no;
Amit Aroraed3e5652010-10-27 12:02:53 +053038
39char *likely_mpoints[] = {
Amit Arora6e774cd2010-10-28 11:31:24 +053040 "/sys/kernel/debug",
41 "/debug",
42 NULL
Amit Aroraed3e5652010-10-27 12:02:53 +053043};
Amit Arora031263a2010-11-09 11:12:41 +053044
45void add_clock_details_recur(struct clock_info *clk);
46void destroy_clocks_info(void);
47void destroy_clocks_info_recur(struct clock_info *clock);