~ubuntu-branches/ubuntu/wily/idlestat/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/0026-Topology-Remove-unused-structure-member.patch/topology.h

  • Committer: Package Import Robot
  • Author(s): Colin King
  • Date: 2015-05-12 10:14:00 UTC
  • Revision ID: package-import@ubuntu.com-20150512101400-kz3j82evqrclq896
Tags: 0.5-2
* Topology: Fix loop bound
* Energy model: Check for error from idlestat_load correctly
* Energy model: Do not exit() with a negative status code
* Utils: Add missing va_start macros
* Idlestat: Suppress static analysis false positives
* Idlestat: Check return value in cpuidle_get_target_residency
* Idlestat: Fix core/cluster cstates
* Idlestat: Add command line options for managing trace buffer
* Idlestat: P-state calculations for cores and clusters
* Energy_model: Don't add phony frequency to template
* Energy_model: Add cluster P-state calculation based on trace data
* Energy model: Make energy file parsing work for TC2
* Energy model: Take out the wakeup energy from the energy calculation
* Idlestat: Add energy model for arm TC2
* Fix alignment for verbose energy model data
* Fix P-state calculations
* Energy model: Remove unused parameter options
* Remove unused parameter cpu from write_cstate_info
* Simplify event counting while loading a trace
* Add -Wunused-parameter to CFLAGS
* Re-enable compile and run on Android platform
* Utils: Add missing va_end macros to verbose_(f)printf
* Energy_model: calculate number of cap and C states correctly
* Topology: Match cpu names only if they begin with "cpu"
* Make read_cpu_topo_info more robust
* Topology: Remove unused structure member
* Handle offline cpus gracefully
* Fix merge_pstates
* Add idlestat manual page (LP: #1334758)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  topology.h
 
3
 *
 
4
 *  Copyright (C) 2014, Linaro Limited.
 
5
 *
 
6
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; version 2 of the License.
 
10
 *
 
11
 *  This program is distributed in the hope that it will be useful, but
 
12
 *  WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
 *  General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License along
 
17
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 
18
 *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 
19
 *
 
20
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
21
 *
 
22
 * Contributors:
 
23
 *     Daniel Lezcano <daniel.lezcano@linaro.org>
 
24
 *     Zoran Markovic <zoran.markovic@linaro.org>
 
25
 *     Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
 
26
 *
 
27
 */
 
28
#ifndef __TOPOLOGY_H
 
29
#define __TOPOLOGY_H
 
30
 
 
31
#include "list.h"
 
32
#include <stdbool.h>
 
33
 
 
34
struct cpuidle_datas;
 
35
struct report_ops;
 
36
 
 
37
struct cpu_cpu {
 
38
        struct list_head list_cpu;
 
39
        int cpu_id;
 
40
        struct list_head list_phy_enum;
 
41
        struct cpuidle_cstates *cstates;
 
42
        struct cpufreq_pstates *pstates;
 
43
        struct cpuidle_cstates *base_cstates;
 
44
        struct cpufreq_pstates *base_pstates;
 
45
};
 
46
 
 
47
struct cpu_core {
 
48
        struct list_head list_core;
 
49
        int core_id;
 
50
        struct list_head cpu_head;
 
51
        int cpu_num;
 
52
        bool is_ht;
 
53
        struct cpuidle_cstates *cstates;
 
54
        struct cpufreq_pstates *pstates;
 
55
        struct cpuidle_cstates *base_cstates;
 
56
        struct cpufreq_pstates *base_pstates;
 
57
};
 
58
 
 
59
struct cpu_physical {
 
60
        struct list_head list_physical;
 
61
        int physical_id;
 
62
        struct list_head core_head;
 
63
        int core_num;
 
64
        struct list_head cpu_enum_head;
 
65
        struct cpuidle_cstates *cstates;
 
66
        struct cpufreq_pstates *pstates;
 
67
        struct cpuidle_cstates *base_cstates;
 
68
        struct cpufreq_pstates *base_pstates;
 
69
};
 
70
 
 
71
struct cpu_topology {
 
72
        struct list_head physical_head;
 
73
        int physical_num;
 
74
};
 
75
 
 
76
extern struct cpu_topology *alloc_cpu_topo_info(void);
 
77
extern struct cpu_topology *read_cpu_topo_info(FILE *f, char *buf);
 
78
extern struct cpu_topology *read_sysfs_cpu_topo(void);
 
79
extern int release_cpu_topo_info(struct cpu_topology *topo);
 
80
extern int output_cpu_topo_info(struct cpu_topology *topo, FILE *f);
 
81
extern void assign_baseline_in_topo(struct cpuidle_datas *datas);
 
82
extern int release_cpu_topo_cstates(struct cpu_topology *topo);
 
83
extern int dump_cpu_topo_info(struct report_ops *ops, void *report_data, int (*dump)(struct report_ops *, void *, void *, char *, void *), struct cpu_topology *topo, int cstate);
 
84
 
 
85
extern struct cpu_physical *cpu_to_cluster(int cpuid, struct cpu_topology *topo);
 
86
extern struct cpu_core *cpu_to_core(int cpuid, struct cpu_topology *topo);
 
87
 
 
88
#define core_for_each_cpu(cpu, core)                            \
 
89
        list_for_each_entry(cpu, &core->cpu_head, list_cpu)
 
90
 
 
91
#define cluster_for_each_core(core, clust)                      \
 
92
        list_for_each_entry(core, &clust->core_head, list_core)
 
93
 
 
94
#define cluster_for_each_cpu(cpu, clust)                        \
 
95
        list_for_each_entry(cpu, &clust->cpu_enum_head, list_phy_enum)
 
96
 
 
97
#define topo_for_each_cluster(clust, topo)                      \
 
98
        list_for_each_entry(clust, &topo->physical_head, list_physical)
 
99
 
 
100
extern int cluster_get_least_cstate(struct cpu_physical *clust);
 
101
extern int cluster_get_highest_freq(struct cpu_physical *clust);
 
102
#define get_affected_cluster_least_cstate(cpuid, topo)          \
 
103
        cluster_get_least_cstate(cpu_to_cluster(cpuid, topo))
 
104
#define get_affected_cluster_highest_freq(cpuid, topo)          \
 
105
        cluster_get_highest_freq(cpu_to_cluster(cpuid, topo))
 
106
 
 
107
extern int core_get_least_cstate(struct cpu_core *core);
 
108
extern int core_get_highest_freq(struct cpu_core *core);
 
109
#define get_affected_core_least_cstate(cpuid, topo)             \
 
110
        core_get_least_cstate(cpu_to_core(cpuid, topo))
 
111
#define get_affected_core_highest_freq(cpuid, topo)             \
 
112
        core_get_highest_freq(cpu_to_core(cpuid, topo))
 
113
 
 
114
extern int setup_topo_states(struct cpuidle_datas *datas);
 
115
 
 
116
#endif