hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/kernel/time/clocksource.c
....@@ -1007,8 +1007,8 @@
10071007
10081008 clocksource_update_max_deferment(cs);
10091009
1010
- pr_info("%s: mask: 0x%llx max_cycles: 0x%llx, max_idle_ns: %lld ns\n",
1011
- cs->name, cs->mask, cs->max_cycles, cs->max_idle_ns);
1010
+ pr_info("%s: freq: %Lu Hz, mask: 0x%llx max_cycles: 0x%llx, max_idle_ns: %lld ns\n",
1011
+ cs->name, (u64)freq * scale, cs->mask, cs->max_cycles, cs->max_idle_ns);
10121012 }
10131013 EXPORT_SYMBOL_GPL(__clocksource_update_freq_scale);
10141014
....@@ -1275,10 +1275,36 @@
12751275 }
12761276 static DEVICE_ATTR_RO(available_clocksource);
12771277
1278
+/**
1279
+ * vdso_clocksource_show - sysfs interface for vDSO type of
1280
+ * current clocksource
1281
+ * @dev: unused
1282
+ * @attr: unused
1283
+ * @buf: char buffer to be filled with vDSO type
1284
+ */
1285
+static ssize_t vdso_clocksource_show(struct device *dev,
1286
+ struct device_attribute *attr,
1287
+ char *buf)
1288
+{
1289
+ ssize_t count = 0, type;
1290
+
1291
+ mutex_lock(&clocksource_mutex);
1292
+ type = curr_clocksource->vdso_type;
1293
+ count = snprintf(buf, PAGE_SIZE, "%s\n",
1294
+ type == CLOCKSOURCE_VDSO_NONE ? "none" :
1295
+ type == CLOCKSOURCE_VDSO_ARCHITECTED ? "architected" :
1296
+ "mmio");
1297
+ mutex_unlock(&clocksource_mutex);
1298
+
1299
+ return count;
1300
+}
1301
+static DEVICE_ATTR_RO(vdso_clocksource);
1302
+
12781303 static struct attribute *clocksource_attrs[] = {
12791304 &dev_attr_current_clocksource.attr,
12801305 &dev_attr_unbind_clocksource.attr,
12811306 &dev_attr_available_clocksource.attr,
1307
+ &dev_attr_vdso_clocksource.attr,
12821308 NULL
12831309 };
12841310 ATTRIBUTE_GROUPS(clocksource);