aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
diff options
context:
space:
mode:
authorSteven Hartland <smh@FreeBSD.org>2015-01-17 14:44:59 +0000
committerSteven Hartland <smh@FreeBSD.org>2015-01-17 14:44:59 +0000
commitbc96366c864c07ef352edb92017357917c75b36c (patch)
tree09e9633064b6303a8afc6891fff761eb6e399cee /cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
parentb0b74fb366450ac61b7df38daa92bc19cbfc3ecc (diff)
downloadsrc-bc96366c864c07ef352edb92017357917c75b36c.tar.gz
src-bc96366c864c07ef352edb92017357917c75b36c.zip
Mechanically convert cddl sun #ifdef's to illumos
Since the upstream for cddl code is now illumos not sun, mechanically convert all sun #ifdef's to illumos #ifdef's which have been used in all newer code for some time. Also do a manual pass to correct the use if #ifdef comments as per style(9) as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos. MFC after: 1 month Sponsored by: Multiplay
Notes
Notes: svn path=/head/; revision=277300
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/lockstat/lockstat.c')
-rw-r--r--cddl/contrib/opensolaris/cmd/lockstat/lockstat.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
index 0a609d773cf6..ad512c1c92c4 100644
--- a/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
+++ b/cddl/contrib/opensolaris/cmd/lockstat/lockstat.c
@@ -46,10 +46,9 @@
#include <signal.h>
#include <assert.h>
-#if defined(sun)
+#ifdef illumos
#define GETOPT_EOF EOF
#else
-/* FreeBSD */
#include <sys/time.h>
#include <sys/resource.h>
@@ -57,7 +56,7 @@
#define GETOPT_EOF (-1)
typedef uintptr_t pc_t;
-#endif /* defined(sun) */
+#endif
#define LOCKSTAT_OPTSTR "x:bths:n:d:i:l:f:e:ckwWgCHEATID:RpPo:V"
@@ -214,10 +213,9 @@ static ls_event_info_t g_event_info[LS_MAX_EVENTS] = {
{ 'H', "Lock", "Unknown event (type 53)", "units" },
{ 'H', "Lock", "Unknown event (type 54)", "units" },
{ 'H', "Lock", "Unknown event (type 55)", "units" },
-#if defined(sun)
+#ifdef illumos
{ 'I', "CPU+PIL", "Profiling interrupt", "nsec",
#else
- /* FreeBSD */
{ 'I', "CPU+Pri_Class", "Profiling interrupt", "nsec",
#endif
"profile:::profile-97", NULL },
@@ -231,7 +229,7 @@ static ls_event_info_t g_event_info[LS_MAX_EVENTS] = {
{ 'E', "Lock", "Lockstat record failure", "(N/A)" },
};
-#if !defined(sun)
+#ifndef illumos
static char *g_pri_class[] = {
"",
"Intr",
@@ -598,7 +596,7 @@ filter_add(char **filt, char *what, uintptr_t base, uintptr_t size)
*filt[0] = '\0';
}
-#if defined(sun)
+#ifdef illumos
(void) sprintf(c, "%s(%s >= 0x%p && %s < 0x%p)", *filt[0] != '\0' ?
" || " : "", what, (void *)base, what, (void *)(base + size));
#else
@@ -676,7 +674,7 @@ dprog_addevent(int event)
* the number of nanoseconds) is the number of nanoseconds
* late -- and it's stored in arg2.
*/
-#if defined(sun)
+#ifdef illumos
arg0 = "(uintptr_t)curthread->t_cpu + \n"
"\t curthread->t_cpu->cpu_profile_pil";
#else
@@ -824,7 +822,7 @@ dprog_compile()
}
static void
-#if defined(sun)
+#ifdef illumos
status_fire(void)
#else
status_fire(int i)
@@ -1423,7 +1421,7 @@ main(int argc, char **argv)
exit(127);
}
-#if defined(sun)
+#ifdef illumos
while (waitpid(child, &status, WEXITED) != child)
#else
while (waitpid(child, &status, 0) != child)
@@ -1468,7 +1466,7 @@ main(int argc, char **argv)
dfail("failed to walk aggregate");
}
-#if defined(sun)
+#ifdef illumos
if ((data_buf = memalign(sizeof (uint64_t),
(g_nrecs + 1) * g_recsize)) == NULL)
#else
@@ -1500,7 +1498,7 @@ main(int argc, char **argv)
if (g_gflag) {
lsrec_t *newlsp, *oldlsp;
-#if defined(sun)
+#ifdef illumos
newlsp = memalign(sizeof (uint64_t),
g_nrecs_used * LS_TIME * (g_stkdepth + 1));
#else
@@ -1664,7 +1662,7 @@ format_symbol(char *buf, uintptr_t addr, int show_size)
else if (symoff == 0)
(void) sprintf(buf, "%s", symname);
else if (symoff < 16 && bcmp(symname, "cpu[", 4) == 0) /* CPU+PIL */
-#if defined(sun)
+#ifdef illumos
(void) sprintf(buf, "%s+%ld", symname, (long)symoff);
#else
(void) sprintf(buf, "%s+%s", symname, g_pri_class[(int)symoff]);