blob: cc17e86be281f74b22a2b2d5f53c85a0790e795b [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;
23
Amit Arora04f97742010-11-16 11:28:57 +053024#define MAX_LINES 120
Amit Arora031263a2010-11-09 11:12:41 +053025
Amit Aroraed3e5652010-10-27 12:02:53 +053026struct clock_info {
Amit Arora6e774cd2010-10-28 11:31:24 +053027 char name[NAME_MAX];
28 int flags;
29 int rate;
30 int usecount;
31 int num_children;
32 int last_child;
Amit Arora031263a2010-11-09 11:12:41 +053033 int expanded;
Amit Aroraac4e8652010-11-09 11:16:53 +053034 int level;
Amit Arora6e774cd2010-10-28 11:31:24 +053035 struct clock_info *parent;
36 struct clock_info **children;
Amit Aroraed3e5652010-10-27 12:02:53 +053037} *clocks_info;
38
Amit Arora031263a2010-11-09 11:12:41 +053039char clock_lines[MAX_LINES][128];
40int clock_line_no;
Amit Aroraac4e8652010-11-09 11:16:53 +053041int old_clock_line_no;
Amit Aroraed3e5652010-10-27 12:02:53 +053042
Daniel Lezcanof0e06652011-03-26 22:06:19 +010043extern int clock_init(void);
44
Amit Aroraac4e8652010-11-09 11:16:53 +053045void add_clock_details_recur(struct clock_info *clk, int hrow, int selected);
Amit Arora031263a2010-11-09 11:12:41 +053046void destroy_clocks_info(void);
47void destroy_clocks_info_recur(struct clock_info *clock);
Amit Aroraac4e8652010-11-09 11:16:53 +053048void collapse_all_subclocks(struct clock_info *clock);
Amit Aroraf4fb8102010-11-30 13:55:50 +053049struct clock_info *find_clock(struct clock_info *clk, char *clkarg);