]> err.no Git - linux-2.6/blobdiff - arch/ia64/sn/kernel/sn2/sn_hwperf.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6] / arch / ia64 / sn / kernel / sn2 / sn_hwperf.c
index 0513aacac8c13898a8e7edf57cfe9530b13e553d..70db21f3df215afb95140b8fbbef00e06eabf4c6 100644 (file)
@@ -3,7 +3,7 @@
  * License.  See the file "COPYING" in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2004-2005 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2004-2006 Silicon Graphics, Inc. All rights reserved.
  *
  * SGI Altix topology and hardware performance monitoring API.
  * Mark Goodwin <markgw@sgi.com>. 
@@ -476,8 +476,8 @@ static int sn_topology_show(struct seq_file *s, void *d)
                                for_each_online_cpu(j) {
                                        seq_printf(s, j ? ":%d" : ", dist %d",
                                                node_distance(
-                                                   cpuid_to_cnodeid(i),
-                                                   cpuid_to_cnodeid(j)));
+                                                   cpu_to_node(i),
+                                                   cpu_to_node(j)));
                                }
                                seq_putc(s, '\n');
                        }
@@ -743,13 +743,14 @@ sn_hwperf_ioctl(struct inode *in, struct file *fp, u32 op, u64 arg)
                if ((r = sn_hwperf_enum_objects(&nobj, &objs)) == 0) {
                        memset(p, 0, a.sz);
                        for (i = 0; i < nobj; i++) {
+                               int cpuobj_index = 0;
                                if (!SN_HWPERF_IS_NODE(objs + i))
                                        continue;
                                node = sn_hwperf_obj_to_cnode(objs + i);
                                for_each_online_cpu(j) {
                                        if (node != cpu_to_node(j))
                                                continue;
-                                       cpuobj = (struct sn_hwperf_object_info *) p + j;
+                                       cpuobj = (struct sn_hwperf_object_info *) p + cpuobj_index++;
                                        slice = 'a' + cpuid_to_slice(j);
                                        cdata = cpu_data(j);
                                        cpuobj->id = j;
@@ -972,6 +973,9 @@ static int __devinit sn_hwperf_misc_register_init(void)
 {
        int e;
 
+       if (!ia64_platform_is("sn2"))
+               return 0;
+
        sn_hwperf_init();
 
        /*