Date: Sun, 28 Feb 2010 01:36:31 -0700 (MST) From: "M. Warner Losh" <imp@bsdimp.com> To: rpaulo@FreeBSD.org Cc: jkoshy@FreeBSD.org, embedded@FreeBSD.org, fabient@FreeBSD.org Subject: Re: 3rd, and hopefully final, MIPS 24K hwpmc patch... Message-ID: <20100228.013631.850602504923951271.imp@bsdimp.com> In-Reply-To: <BD8E018D-68E9-4566-BB0F-D52B84A62C11@freebsd.org> References: <9D9E6892-ABE5-44B3-965B-383D80366D1B@neville-neil.com> <BD8E018D-68E9-4566-BB0F-D52B84A62C11@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <BD8E018D-68E9-4566-BB0F-D52B84A62C11@freebsd.org> Rui Paulo <rpaulo@FreeBSD.org> writes: : > http://people.freebsd.org/~gnn/mipshwpmc_3.diff : > : > The biggest change was breaking out MIPS24K from generic MIPS, which will allow for the easy addition : > of other types of MIPS chips in the near future. @@ -2681,6 +2724,10 @@ } else if (pe >= PMC_EV_XSCALE_FIRST && pe <= PMC_EV_XSCALE_LAST) { ev = xscale_event_table; evfence = xscale_event_table + PMC_EVENT_TABLE_SIZE(xscale); + } else if (pe >= PMC_EV_MIPS24K_FIRST && pe <= PMC_EV_MIPS24K_LAST) { + ev = mips24k_event_table; + evfence = mips24k_event_table + PMC_EVENT_TABLE_SIZE(mips24k +); Looks like a stray new line. There does seem to be a number of places where we mix mips, arm, and x86 CPUs in case statements and the like. Yet there are other places we carefully ifdef them. What's the determining factors here? Also, the mips24k counters are specific to the mips24k, but the harvesting of the counters is fairly generic to the mips architecture (when counters are present). Why encode all the counter knowledge in the kernel when it might make better sense to have the userland routines do that decoding based on the core that's used? Maybe I'm misunderstanding something here, but I do know that linux asks the CPU how many performance counters there are and harvests them generically across a wide range of MIPS cores. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100228.013631.850602504923951271.imp>