+3
-3
arch/x86/events/intel/cstate.c
+3
-3
arch/x86/events/intel/cstate.c
···
107
107
MODULE_LICENSE("GPL");
108
108
109
109
#define DEFINE_CSTATE_FORMAT_ATTR(_var, _name, _format) \
110
-
static ssize_t __cstate_##_var##_show(struct kobject *kobj, \
111
-
struct kobj_attribute *attr, \
110
+
static ssize_t __cstate_##_var##_show(struct device *dev, \
111
+
struct device_attribute *attr, \
112
112
char *page) \
113
113
{ \
114
114
BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE); \
115
115
return sprintf(page, _format "\n"); \
116
116
} \
117
-
static struct kobj_attribute format_attr_##_var = \
117
+
static struct device_attribute format_attr_##_var = \
118
118
__ATTR(_name, 0444, __cstate_##_var##_show, NULL)
119
119
120
120
static ssize_t cstate_get_attr_cpumask(struct device *dev,
+2
-2
arch/x86/events/intel/uncore.c
+2
-2
arch/x86/events/intel/uncore.c
···
94
94
return map;
95
95
}
96
96
97
-
ssize_t uncore_event_show(struct kobject *kobj,
98
-
struct kobj_attribute *attr, char *buf)
97
+
ssize_t uncore_event_show(struct device *dev,
98
+
struct device_attribute *attr, char *buf)
99
99
{
100
100
struct uncore_event_desc *event =
101
101
container_of(attr, struct uncore_event_desc, attr);
+6
-6
arch/x86/events/intel/uncore.h
+6
-6
arch/x86/events/intel/uncore.h
···
157
157
#define UNCORE_BOX_FLAG_CFL8_CBOX_MSR_OFFS 2
158
158
159
159
struct uncore_event_desc {
160
-
struct kobj_attribute attr;
160
+
struct device_attribute attr;
161
161
const char *config;
162
162
};
163
163
···
179
179
struct pci2phy_map *__find_pci2phy_map(int segment);
180
180
int uncore_pcibus_to_physid(struct pci_bus *bus);
181
181
182
-
ssize_t uncore_event_show(struct kobject *kobj,
183
-
struct kobj_attribute *attr, char *buf);
182
+
ssize_t uncore_event_show(struct device *dev,
183
+
struct device_attribute *attr, char *buf);
184
184
185
185
static inline struct intel_uncore_pmu *dev_to_uncore_pmu(struct device *dev)
186
186
{
···
201
201
}
202
202
203
203
#define DEFINE_UNCORE_FORMAT_ATTR(_var, _name, _format) \
204
-
static ssize_t __uncore_##_var##_show(struct kobject *kobj, \
205
-
struct kobj_attribute *attr, \
204
+
static ssize_t __uncore_##_var##_show(struct device *dev, \
205
+
struct device_attribute *attr, \
206
206
char *page) \
207
207
{ \
208
208
BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE); \
209
209
return sprintf(page, _format "\n"); \
210
210
} \
211
-
static struct kobj_attribute format_attr_##_var = \
211
+
static struct device_attribute format_attr_##_var = \
212
212
__ATTR(_name, 0444, __uncore_##_var##_show, NULL)
213
213
214
214
static inline bool uncore_pmc_fixed(int idx)
+1
-13
arch/x86/events/rapl.c
+1
-13
arch/x86/events/rapl.c
···
93
93
* any other bit is reserved
94
94
*/
95
95
#define RAPL_EVENT_MASK 0xFFULL
96
-
97
-
#define DEFINE_RAPL_FORMAT_ATTR(_var, _name, _format) \
98
-
static ssize_t __rapl_##_var##_show(struct kobject *kobj, \
99
-
struct kobj_attribute *attr, \
100
-
char *page) \
101
-
{ \
102
-
BUILD_BUG_ON(sizeof(_format) >= PAGE_SIZE); \
103
-
return sprintf(page, _format "\n"); \
104
-
} \
105
-
static struct kobj_attribute format_attr_##_var = \
106
-
__ATTR(_name, 0444, __rapl_##_var##_show, NULL)
107
-
108
96
#define RAPL_CNTR_WIDTH 32
109
97
110
98
#define RAPL_EVENT_ATTR_STR(_name, v, str) \
···
429
441
.attrs = attrs_empty,
430
442
};
431
443
432
-
DEFINE_RAPL_FORMAT_ATTR(event, event, "config:0-7");
444
+
PMU_FORMAT_ATTR(event, "config:0-7");
433
445
static struct attribute *rapl_formats_attr[] = {
434
446
&format_attr_event.attr,
435
447
NULL,