From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 14 00:20:33 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D1F108BA; Sun, 14 Apr 2013 00:20:33 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BF0EC1899; Sun, 14 Apr 2013 00:20:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0KXkF049608; Sun, 14 Apr 2013 00:20:33 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0KXaU049607; Sun, 14 Apr 2013 00:20:33 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304140020.r3E0KXaU049607@svn.freebsd.org> From: Sean Bruno Date: Sun, 14 Apr 2013 00:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249455 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:20:33 -0000 Author: sbruno Date: Sun Apr 14 00:20:32 2013 New Revision: 249455 URL: http://svnweb.freebsd.org/changeset/base/249455 Log: MFC r248824 & r248826 Fix compile with CISS_DEBUG defined Fix DDB hook to actually work again Modified: stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Sat Apr 13 22:45:41 2013 (r249454) +++ stable/9/sys/dev/ciss/ciss.c Sun Apr 14 00:20:32 2013 (r249455) @@ -1868,7 +1868,7 @@ ciss_accept_media(struct ciss_softc *sc, ldrive = CISS_LUN_TO_TARGET(ld->cl_address.logical.lun); - debug(0, "bringing logical drive %d back online"); + debug(0, "bringing logical drive %d back online", ldrive); /* * Build a CISS BMIC command to bring the drive back online. @@ -4307,6 +4307,9 @@ ciss_print_ldrive(struct ciss_softc *sc, } #ifdef CISS_DEBUG +#include "opt_ddb.h" +#ifdef DDB +#include /************************************************************************ * Print information about the controller/driver. */ @@ -4341,8 +4344,7 @@ ciss_print_adapter(struct ciss_softc *sc } /* DDB hook */ -static void -ciss_print0(void) +DB_COMMAND(ciss_prt, db_ciss_prt) { struct ciss_softc *sc; @@ -4354,6 +4356,7 @@ ciss_print0(void) } } #endif +#endif /************************************************************************ * Return a name for a logical drive status value. From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 14 00:49:08 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D6D2CE94; Sun, 14 Apr 2013 00:49:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C92451ABC; Sun, 14 Apr 2013 00:49:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3E0n8ua058445; Sun, 14 Apr 2013 00:49:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3E0n8br058444; Sun, 14 Apr 2013 00:49:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201304140049.r3E0n8br058444@svn.freebsd.org> From: Eitan Adler Date: Sun, 14 Apr 2013 00:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249456 - stable/9/usr.bin/fstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 00:49:08 -0000 Author: eadler Date: Sun Apr 14 00:49:08 2013 New Revision: 249456 URL: http://svnweb.freebsd.org/changeset/base/249456 Log: MFC r249359: fuser(1) requires a filename. Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.bin/fstat/fuser.1 Directory Properties: stable/9/usr.bin/fstat/ (props changed) Modified: stable/9/usr.bin/fstat/fuser.1 ============================================================================== --- stable/9/usr.bin/fstat/fuser.1 Sun Apr 14 00:20:32 2013 (r249455) +++ stable/9/usr.bin/fstat/fuser.1 Sun Apr 14 00:49:08 2013 (r249456) @@ -36,7 +36,7 @@ .Op Fl M Ar core .Op Fl N Ar system .Op Fl s Ar signal -.Op Ar +.Ar .Sh DESCRIPTION The .Nm From owner-svn-src-stable-9@FreeBSD.ORG Sun Apr 14 22:38:30 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83A9E70E; Sun, 14 Apr 2013 22:38:30 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73D7466A; Sun, 14 Apr 2013 22:38:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3EMcUc2056863; Sun, 14 Apr 2013 22:38:30 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3EMcSuY056852; Sun, 14 Apr 2013 22:38:28 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201304142238.r3EMcSuY056852@svn.freebsd.org> From: Josh Paetzel Date: Sun, 14 Apr 2013 22:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249490 - in stable/9: sbin/iscontrol sys/dev/iscsi/initiator X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Apr 2013 22:38:30 -0000 Author: jpaetzel Date: Sun Apr 14 22:38:28 2013 New Revision: 249490 URL: http://svnweb.freebsd.org/changeset/base/249490 Log: MFC 234223: Update to version 2.3.1.0 MFC 234284, 234425, 234481: Unbreak the build caused by 234233 PR: kern/157770 Obtained from: Daniel Braniss Modified: stable/9/sbin/iscontrol/Makefile stable/9/sbin/iscontrol/iscontrol.8 stable/9/sbin/iscontrol/iscontrol.c stable/9/sbin/iscontrol/iscsi.conf.5 stable/9/sys/dev/iscsi/initiator/isc_subr.c stable/9/sys/dev/iscsi/initiator/iscsi.c stable/9/sys/dev/iscsi/initiator/iscsi_subr.c stable/9/sys/dev/iscsi/initiator/iscsivar.h Directory Properties: stable/9/sbin/iscontrol/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sbin/iscontrol/Makefile ============================================================================== --- stable/9/sbin/iscontrol/Makefile Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/Makefile Sun Apr 14 22:38:28 2013 (r249490) @@ -7,8 +7,7 @@ LDADD= -lcam -lmd S= ${.CURDIR}/../../sys WARNS?= 3 -CFLAGS += -I$S -#CFLAGS += -g -DDEBUG +CFLAGS+= -I$S MAN= iscsi.conf.5 iscontrol.8 Modified: stable/9/sbin/iscontrol/iscontrol.8 ============================================================================== --- stable/9/sbin/iscontrol/iscontrol.8 Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscontrol.8 Sun Apr 14 22:38:28 2013 (r249490) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 22, 2007 +.Dd August 9, 2010 .Dt ISCONTROL 8 .Os .Sh NAME Modified: stable/9/sbin/iscontrol/iscontrol.c ============================================================================== --- stable/9/sbin/iscontrol/iscontrol.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscontrol.c Sun Apr 14 22:38:28 2013 (r249490) @@ -44,18 +44,22 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -#include +#include #include #include +#include +#include +#include +#include #include +#include #include #include #include "iscontrol.h" +static char version[] = "2.3.1"; // keep in sync with iscsi_initiator + #define USAGE "[-v] [-d] [-c config] [-n name] [-t target] [-p pidfile]" #define OPTIONS "vdc:t:n:p:" @@ -109,6 +113,13 @@ isc_opt_t opvals = { .immediateData = TRUE, }; +static void +usage(const char *pname) +{ + fprintf(stderr, "usage: %s " USAGE "\n", pname); + exit(1); +} + int lookup(token_t *tbl, char *m) { @@ -124,20 +135,40 @@ int main(int cc, char **vv) { int ch, disco; - char *pname, *pidfile, *p, *q, *ta, *kw; + char *pname, *pidfile, *p, *q, *ta, *kw, *v; isc_opt_t *op; FILE *fd; + size_t n; op = &opvals; iscsidev = "/dev/"ISCSIDEV; fd = NULL; pname = vv[0]; - if((p = strrchr(pname, '/')) != NULL) - pname = p + 1; + if ((pname = basename(pname)) == NULL) + err(1, "basename"); kw = ta = 0; disco = 0; pidfile = NULL; + /* + | check for driver & controller version match + */ + n = 0; +#define VERSION_OID_S "net.iscsi_initiator.driver_version" + if (sysctlbyname(VERSION_OID_S, 0, &n, 0, 0) != 0) { + if (errno == ENOENT) + errx(1, "sysctlbyname(\"" VERSION_OID_S "\") " + "failed; is the iscsi driver loaded?"); + err(1, "sysctlbyname(\"" VERSION_OID_S "\")"); + } + v = malloc(n+1); + if (v == NULL) + err(1, "malloc"); + if (sysctlbyname(VERSION_OID_S, v, &n, 0, 0) != 0) + err(1, "sysctlbyname"); + + if (strncmp(version, v, 3) != 0) + errx(1, "versions mismatch"); while((ch = getopt(cc, vv, OPTIONS)) != -1) { switch(ch) { @@ -146,10 +177,8 @@ main(int cc, char **vv) break; case 'c': fd = fopen(optarg, "r"); - if(fd == NULL) { - perror(optarg); - exit(1); - } + if (fd == NULL) + err(1, "fopen(\"%s\")", optarg); break; case 'd': disco = 1; @@ -164,9 +193,7 @@ main(int cc, char **vv) pidfile = optarg; break; default: - badu: - fprintf(stderr, "Usage: %s %s\n", pname, USAGE); - exit(1); + usage(pname); } } if(fd == NULL) @@ -187,8 +214,8 @@ main(int cc, char **vv) op->targetAddress = ta; if(op->targetAddress == NULL) { - fprintf(stderr, "No target!\n"); - goto badu; + warnx("no target specified!"); + usage(pname); } q = op->targetAddress; if(*q == '[' && (q = strchr(q, ']')) != NULL) { @@ -206,7 +233,7 @@ main(int cc, char **vv) op->targetPortalGroupTag = atoi(p); } if(op->initiatorName == 0) { - char hostname[256]; + char hostname[MAXHOSTNAMELEN]; if(op->iqn) { if(gethostname(hostname, sizeof(hostname)) == 0) Modified: stable/9/sbin/iscontrol/iscsi.conf.5 ============================================================================== --- stable/9/sbin/iscontrol/iscsi.conf.5 Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sbin/iscontrol/iscsi.conf.5 Sun Apr 14 22:38:28 2013 (r249490) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd June 5, 2007 .Dt ISCSI.CONF 5 .Os .Sh NAME Modified: stable/9/sys/dev/iscsi/initiator/isc_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/isc_subr.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/isc_subr.c Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,104 @@ i_strdupin(char *s, size_t maxlen) return q; } +#if __FreeBSD_version < 800000 +/*****************************************************************/ +/* */ +/* CRC LOOKUP TABLE */ +/* ================ */ +/* The following CRC lookup table was generated automagically */ +/* by the Rocksoft^tm Model CRC Algorithm Table Generation */ +/* Program V1.0 using the following model parameters: */ +/* */ +/* Width : 4 bytes. */ +/* Poly : 0x1EDC6F41L */ +/* Reverse : TRUE. */ +/* */ +/* For more information on the Rocksoft^tm Model CRC Algorithm, */ +/* see the document titled "A Painless Guide to CRC Error */ +/* Detection Algorithms" by Ross Williams */ +/* (ross@guest.adelaide.edu.au.). This document is likely to be */ +/* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". */ +/* */ +/*****************************************************************/ + +static uint32_t crc32Table[256] = { + 0x00000000L, 0xF26B8303L, 0xE13B70F7L, 0x1350F3F4L, + 0xC79A971FL, 0x35F1141CL, 0x26A1E7E8L, 0xD4CA64EBL, + 0x8AD958CFL, 0x78B2DBCCL, 0x6BE22838L, 0x9989AB3BL, + 0x4D43CFD0L, 0xBF284CD3L, 0xAC78BF27L, 0x5E133C24L, + 0x105EC76FL, 0xE235446CL, 0xF165B798L, 0x030E349BL, + 0xD7C45070L, 0x25AFD373L, 0x36FF2087L, 0xC494A384L, + 0x9A879FA0L, 0x68EC1CA3L, 0x7BBCEF57L, 0x89D76C54L, + 0x5D1D08BFL, 0xAF768BBCL, 0xBC267848L, 0x4E4DFB4BL, + 0x20BD8EDEL, 0xD2D60DDDL, 0xC186FE29L, 0x33ED7D2AL, + 0xE72719C1L, 0x154C9AC2L, 0x061C6936L, 0xF477EA35L, + 0xAA64D611L, 0x580F5512L, 0x4B5FA6E6L, 0xB93425E5L, + 0x6DFE410EL, 0x9F95C20DL, 0x8CC531F9L, 0x7EAEB2FAL, + 0x30E349B1L, 0xC288CAB2L, 0xD1D83946L, 0x23B3BA45L, + 0xF779DEAEL, 0x05125DADL, 0x1642AE59L, 0xE4292D5AL, + 0xBA3A117EL, 0x4851927DL, 0x5B016189L, 0xA96AE28AL, + 0x7DA08661L, 0x8FCB0562L, 0x9C9BF696L, 0x6EF07595L, + 0x417B1DBCL, 0xB3109EBFL, 0xA0406D4BL, 0x522BEE48L, + 0x86E18AA3L, 0x748A09A0L, 0x67DAFA54L, 0x95B17957L, + 0xCBA24573L, 0x39C9C670L, 0x2A993584L, 0xD8F2B687L, + 0x0C38D26CL, 0xFE53516FL, 0xED03A29BL, 0x1F682198L, + 0x5125DAD3L, 0xA34E59D0L, 0xB01EAA24L, 0x42752927L, + 0x96BF4DCCL, 0x64D4CECFL, 0x77843D3BL, 0x85EFBE38L, + 0xDBFC821CL, 0x2997011FL, 0x3AC7F2EBL, 0xC8AC71E8L, + 0x1C661503L, 0xEE0D9600L, 0xFD5D65F4L, 0x0F36E6F7L, + 0x61C69362L, 0x93AD1061L, 0x80FDE395L, 0x72966096L, + 0xA65C047DL, 0x5437877EL, 0x4767748AL, 0xB50CF789L, + 0xEB1FCBADL, 0x197448AEL, 0x0A24BB5AL, 0xF84F3859L, + 0x2C855CB2L, 0xDEEEDFB1L, 0xCDBE2C45L, 0x3FD5AF46L, + 0x7198540DL, 0x83F3D70EL, 0x90A324FAL, 0x62C8A7F9L, + 0xB602C312L, 0x44694011L, 0x5739B3E5L, 0xA55230E6L, + 0xFB410CC2L, 0x092A8FC1L, 0x1A7A7C35L, 0xE811FF36L, + 0x3CDB9BDDL, 0xCEB018DEL, 0xDDE0EB2AL, 0x2F8B6829L, + 0x82F63B78L, 0x709DB87BL, 0x63CD4B8FL, 0x91A6C88CL, + 0x456CAC67L, 0xB7072F64L, 0xA457DC90L, 0x563C5F93L, + 0x082F63B7L, 0xFA44E0B4L, 0xE9141340L, 0x1B7F9043L, + 0xCFB5F4A8L, 0x3DDE77ABL, 0x2E8E845FL, 0xDCE5075CL, + 0x92A8FC17L, 0x60C37F14L, 0x73938CE0L, 0x81F80FE3L, + 0x55326B08L, 0xA759E80BL, 0xB4091BFFL, 0x466298FCL, + 0x1871A4D8L, 0xEA1A27DBL, 0xF94AD42FL, 0x0B21572CL, + 0xDFEB33C7L, 0x2D80B0C4L, 0x3ED04330L, 0xCCBBC033L, + 0xA24BB5A6L, 0x502036A5L, 0x4370C551L, 0xB11B4652L, + 0x65D122B9L, 0x97BAA1BAL, 0x84EA524EL, 0x7681D14DL, + 0x2892ED69L, 0xDAF96E6AL, 0xC9A99D9EL, 0x3BC21E9DL, + 0xEF087A76L, 0x1D63F975L, 0x0E330A81L, 0xFC588982L, + 0xB21572C9L, 0x407EF1CAL, 0x532E023EL, 0xA145813DL, + 0x758FE5D6L, 0x87E466D5L, 0x94B49521L, 0x66DF1622L, + 0x38CC2A06L, 0xCAA7A905L, 0xD9F75AF1L, 0x2B9CD9F2L, + 0xFF56BD19L, 0x0D3D3E1AL, 0x1E6DCDEEL, 0xEC064EEDL, + 0xC38D26C4L, 0x31E6A5C7L, 0x22B65633L, 0xD0DDD530L, + 0x0417B1DBL, 0xF67C32D8L, 0xE52CC12CL, 0x1747422FL, + 0x49547E0BL, 0xBB3FFD08L, 0xA86F0EFCL, 0x5A048DFFL, + 0x8ECEE914L, 0x7CA56A17L, 0x6FF599E3L, 0x9D9E1AE0L, + 0xD3D3E1ABL, 0x21B862A8L, 0x32E8915CL, 0xC083125FL, + 0x144976B4L, 0xE622F5B7L, 0xF5720643L, 0x07198540L, + 0x590AB964L, 0xAB613A67L, 0xB831C993L, 0x4A5A4A90L, + 0x9E902E7BL, 0x6CFBAD78L, 0x7FAB5E8CL, 0x8DC0DD8FL, + 0xE330A81AL, 0x115B2B19L, 0x020BD8EDL, 0xF0605BEEL, + 0x24AA3F05L, 0xD6C1BC06L, 0xC5914FF2L, 0x37FACCF1L, + 0x69E9F0D5L, 0x9B8273D6L, 0x88D28022L, 0x7AB90321L, + 0xAE7367CAL, 0x5C18E4C9L, 0x4F48173DL, 0xBD23943EL, + 0xF36E6F75L, 0x0105EC76L, 0x12551F82L, 0xE03E9C81L, + 0x34F4F86AL, 0xC69F7B69L, 0xD5CF889DL, 0x27A40B9EL, + 0x79B737BAL, 0x8BDCB4B9L, 0x988C474DL, 0x6AE7C44EL, + 0xBE2DA0A5L, 0x4C4623A6L, 0x5F16D052L, 0xAD7D5351L +}; + +static __inline int +calculate_crc32c(uint32_t crc, const void *buf, size_t size) +{ + const uint8_t *p = buf; + + while (size--) + crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> 8); + return crc; +} +#endif static uint32_t i_crc32c(const void *buf, size_t size, uint32_t crc) Modified: stable/9/sys/dev/iscsi/initiator/iscsi.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsi.c Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include -static char *iscsi_driver_version = "2.2.4.2"; +static char *iscsi_driver_version = "2.3.1"; static struct isc_softc *isc; @@ -231,8 +231,8 @@ iscsi_ioctl(struct cdev *dev, u_long cmd if(error == 0) { sp->proc = td->td_proc; SYSCTL_ADD_INT(&sp->clist, SYSCTL_CHILDREN(sp->oid), - OID_AUTO, "pid", CTLFLAG_RD, - &sp->proc->p_pid, sizeof(pid_t), "control process id"); + OID_AUTO, "pid", CTLFLAG_RD, + &sp->proc->p_pid, sizeof(pid_t), "control process id"); } break; @@ -290,8 +290,7 @@ iscsi_read(struct cdev *dev, struct uio sprintf(buf, "%03d] '%s' '%s'\n", i++, sp->opt.targetAddress, sp->opt.targetName); uiomove(buf, strlen(buf), uio); } - sprintf(buf, "%d/%d /---- free -----/\n", sc->npdu_alloc, sc->npdu_max); - i = 0; + sprintf(buf, "free npdu_alloc=%d, npdu_max=%d\n", sc->npdu_alloc, sc->npdu_max); uiomove(buf, strlen(buf), uio); } else { @@ -696,7 +695,6 @@ iscsi_shutdown(void *v) static void free_pdus(struct isc_softc *sc) { - debug_called(8); if(sc->pdu_zone != NULL) { @@ -777,6 +775,10 @@ iscsi_start(void) sizeof(isc->nsess), "number of active session"); +#ifdef ISCSI_INITIATOR_DEBUG + mtx_init(&iscsi_dbg_mtx, "iscsi_dbg", NULL, MTX_DEF); +#endif + printf("iscsi: version %s\n", iscsi_driver_version); } @@ -814,6 +816,11 @@ iscsi_stop(void) xdebug("sysctl_ctx_free failed"); iscsi_shutdown(isc); // XXX: check EVENTHANDLER_ ... + +#ifdef ISCSI_INITIATOR_DEBUG + mtx_destroy(&iscsi_dbg_mtx); +#endif + free(isc, M_ISCSI); } Modified: stable/9/sys/dev/iscsi/initiator/iscsi_subr.c ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsi_subr.c Sun Apr 14 22:38:28 2013 (r249490) @@ -154,7 +154,7 @@ getSenseData(u_int status, union ccb *cc scsi_rsp_t *cmd = &pp->ipdu.scsi_rsp; caddr_t bp; int sense_len, mustfree = 0; - int error_code, sense_key, asc, ascq; + int error_code, sense_key, asc, ascq; bp = mtod(pq->mp, caddr_t); if((sense_len = scsi_2btoul(bp)) == 0) @@ -176,9 +176,8 @@ getSenseData(u_int status, union ccb *cc scsi->sense_resid = 0; if(cmd->flag & (BIT(1)|BIT(2))) scsi->sense_resid = ntohl(pp->ipdu.scsi_rsp.rcnt); - scsi_extract_sense_len(sense, scsi->sense_len - scsi->sense_resid, - &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); + &error_code, &sense_key, &asc, &ascq, /*show_errors*/ 1); debug(3, "sense_len=%d rcnt=%d sense_resid=%d dsl=%d error_code=%x flags=%x", sense_len, @@ -479,6 +478,8 @@ scsi_encap(struct cam_sim *sim, union cc cmd = &pq->pdu.ipdu.scsi_req; cmd->opcode = ISCSI_SCSI_CMD; cmd->F = 1; +#if 0 +// this breaks at least Isilon's iscsi target. /* | map tag option, default is UNTAGGED */ @@ -488,6 +489,9 @@ scsi_encap(struct cam_sim *sim, union cc case MSG_ORDERED_Q_TAG: cmd->attr = iSCSI_TASK_ORDER; break; case MSG_ACA_TASK: cmd->attr = iSCSI_TASK_ACA; break; } +#else + cmd->attr = iSCSI_TASK_SIMPLE; +#endif dwl(sp, ccb_h->target_lun, (u_char *)&cmd->lun); Modified: stable/9/sys/dev/iscsi/initiator/iscsivar.h ============================================================================== --- stable/9/sys/dev/iscsi/initiator/iscsivar.h Sun Apr 14 21:11:19 2013 (r249489) +++ stable/9/sys/dev/iscsi/initiator/iscsivar.h Sun Apr 14 22:38:28 2013 (r249490) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005-2010 Daniel Braniss + * Copyright (c) 2005-2011 Daniel Braniss * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -204,6 +204,8 @@ struct isc_softc { struct sx unit_sx; uma_zone_t pdu_zone; // pool of free pdu's + TAILQ_HEAD(,pduq) freepdu; + #ifdef ISCSI_INITIATOR_DEBUG int npdu_alloc, npdu_max; // for instrumentation #endif @@ -306,9 +308,11 @@ pdu_alloc(struct isc_softc *isc, int wai return NULL; } #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc++; if(isc->npdu_alloc > isc->npdu_max) isc->npdu_max = isc->npdu_alloc; + mtx_unlock(&iscsi_dbg_mtx); #endif memset(pq, 0, sizeof(pduq_t)); @@ -324,10 +328,12 @@ pdu_free(struct isc_softc *isc, pduq_t * if(pq->buf != NULL) free(pq->buf, M_ISCSIBUF); #endif + uma_zfree(isc->pdu_zone, pq); #ifdef ISCSI_INITIATOR_DEBUG + mtx_lock(&iscsi_dbg_mtx); isc->npdu_alloc--; + mtx_unlock(&iscsi_dbg_mtx); #endif - uma_zfree(isc->pdu_zone, pq); } static __inline void From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 03:10:00 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DA0EAFE3; Mon, 15 Apr 2013 03:10:00 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA8B8E36; Mon, 15 Apr 2013 03:10:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F3A0Wb042288; Mon, 15 Apr 2013 03:10:00 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F3A0Hu042269; Mon, 15 Apr 2013 03:10:00 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304150310.r3F3A0Hu042269@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 15 Apr 2013 03:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249492 - in stable/9: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 03:10:00 -0000 Author: hiren Date: Mon Apr 15 03:09:59 2013 New Revision: 249492 URL: http://svnweb.freebsd.org/changeset/base/249492 Log: MFC: r246166 Update hwpmc to support the Xeon class of Ivybridge processors. case 0x3E: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. No support for uncore events at this time. Approved by: sbruno (mentor) Added: stable/9/lib/libpmc/pmc.ivybridgexeon.3 (contents, props changed) Modified: stable/9/lib/libpmc/Makefile stable/9/lib/libpmc/libpmc.c stable/9/lib/libpmc/pmc.ivybridge.3 stable/9/lib/libpmc/pmc.sandybridge.3 stable/9/lib/libpmc/pmc.sandybridgexeon.3 stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/pmc_events.h stable/9/sys/sys/pmc.h Directory Properties: stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/lib/libpmc/Makefile ============================================================================== --- stable/9/lib/libpmc/Makefile Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/Makefile Mon Apr 15 03:09:59 2013 (r249492) @@ -29,6 +29,7 @@ MAN+= pmc.core.3 MAN+= pmc.core2.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 +MAN+= pmc.ivybridgexeon.3 MAN+= pmc.ucf.3 MAN+= pmc.k7.3 MAN+= pmc.k8.3 Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/libpmc.c Mon Apr 15 03:09:59 2013 (r249492) @@ -187,6 +187,11 @@ static const struct pmc_event_descr ivyb __PMC_EV_ALIAS_IVYBRIDGE() }; +static const struct pmc_event_descr ivybridge_xeon_event_table[] = +{ + __PMC_EV_ALIAS_IVYBRIDGE_XEON() +}; + static const struct pmc_event_descr sandybridge_event_table[] = { __PMC_EV_ALIAS_SANDYBRIDGE() @@ -232,6 +237,7 @@ PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); +PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(sandybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(westmere, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -270,6 +276,7 @@ PMC_CLASS_TABLE_DESC(core, IAP, core, ia PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); +PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); PMC_CLASS_TABLE_DESC(sandybridge_xeon, IAP, sandybridge_xeon, iap); PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); @@ -574,6 +581,8 @@ static struct pmc_event_alias core2_alia #define corei7_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf +#define ivybridge_xeon_aliases core2_aliases +#define ivybridge_xeon_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_aliases core2_aliases #define sandybridge_aliases_without_iaf core2_aliases_without_iaf #define sandybridge_xeon_aliases core2_aliases @@ -804,7 +813,8 @@ iap_allocate_pmc(enum pmc_event pe, char return (-1); } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE || cpu_info.pm_cputype == PMC_CPU_INTEL_SANDYBRIDGE_XEON || - cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE) { + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE || + cpu_info.pm_cputype == PMC_CPU_INTEL_IVYBRIDGE_XEON ) { if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else @@ -2673,6 +2683,10 @@ pmc_event_names_of_class(enum pmc_class ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + ev = ivybridge_xeon_event_table; + count = PMC_EVENT_TABLE_SIZE(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridge); @@ -2968,6 +2982,9 @@ pmc_init(void) case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + PMC_MDEP_INIT_INTEL_V2(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: pmc_class_table[n++] = &ucf_class_table_descr; pmc_class_table[n++] = &sandybridgeuc_class_table_descr; @@ -3106,6 +3123,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = ivybridge_event_table; evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); break; + case PMC_CPU_INTEL_IVYBRIDGE_XEON: + ev = ivybridge_xeon_event_table; + evfence = ivybridge_xeon_event_table + PMC_EVENT_TABLE_SIZE(ivybridge_xeon); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridge_event_table; evfence = sandybridge_event_table + PMC_EVENT_TABLE_SIZE(sandybridge); Modified: stable/9/lib/libpmc/pmc.ivybridge.3 ============================================================================== --- stable/9/lib/libpmc/pmc.ivybridge.3 Mon Apr 15 03:02:55 2013 (r249491) +++ stable/9/lib/libpmc/pmc.ivybridge.3 Mon Apr 15 03:09:59 2013 (r249492) @@ -854,6 +854,7 @@ Dirty L2 cache lines evicted by the MLC .Xr pmc.p6 3 , .Xr pmc.corei7 3 , .Xr pmc.corei7uc 3 , +.Xr pmc.ivybridgexeon 3 , .Xr pmc.sandybridge 3 , .Xr pmc.sandybridgeuc 3 , .Xr pmc.sandybridgexeon 3 , Added: stable/9/lib/libpmc/pmc.ivybridgexeon.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libpmc/pmc.ivybridgexeon.3 Mon Apr 15 03:09:59 2013 (r249492) @@ -0,0 +1,911 @@ +.\" Copyright (c) 2013 Hiren Panchasara +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Jan 25, 2013 +.Dt PMC.IVYBRIDGEXEON 3 +.Os +.Sh NAME +.Nm pmc.ivybridgexeon +.Nd measurement events for +.Tn Intel +.Tn Ivy Bridge Xeon +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Ivy Bridge Xeon" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to three classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Ivy Bridge Xeon PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +.%N "Order Number: 325462-045US" +.%D January 2013 +.%Q "Intel Corporation" +.Re +.Ss IVYBRIDGE FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss IVYBRIDGE PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li REQ_DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full and partial +cachelines as well as demand data page table entry cacheline reads. Does not +count L2 data read prefetches or instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNP_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Ivy Bridge programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +loads blocked by overlapping with store buffer that cannot be forwarded . +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store- address uops dispatched to L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare on address. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 81H +Misses in all TLB levels that cause a page walk of any page size from demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_COMPLETED +.Pq Event 08H , Umask 82H +Misses in all TLB levels that caused page walk completed of any size by demand loads. +.It Li DTLB_LOAD_MISSES.DEMAND_LD_WALK_DURATION +.Pq Event 08H , Umask 84H +Cycle PMH is busy with a walk due to demand loads. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +Increments each cycle the # of Uops issued by the RAT to RS. +Set Cmask = 1, Inv = 1to count stalled cycles. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles of this core. +.It Li UOPS_ISSUED.FLAGS_MERGE +.Pq Event 0EH , Umask 10H +Number of flags-merge uops allocated. Such uops adds delay. +.It Li UOPS_ISSUED.SLOW_LEA +.Pq Event 0EH , Umask 20H +Number of slow LEA or similar uops allocated. Such uop has 3 sources (e.g. 2 +sources + immediate) regardless if as a result of LEA instruction or not. +.It Li UOPS_ISSUED.SINGLE_MUL +.Pq Event 0EH , Umask 40H +Number of multiply packed/scalar single precision uops allocated. +.It Li ARITH.FPU_DIV_ACTIVE +.Pq Event 14H , Umask 01H +Cycles that the divider is active, includes INT and FP. Set 'edge =1, +cmask=1' to count the number of divides. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 01H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask 03H +Counts any demand and L1 HW prefetch data load requests to L2. +.It Li L2_RQSTS.RFO_HITS +.Pq Event 24H , Umask 04H +Counts the number of store RFO requests that hit the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 08H +Counts the number of store RFO requests that miss the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask 0CH +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 10H +Number of instruction fetches that hit the L2 cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 20H +Number of instruction fetches that missed the L2 cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask 30H +Counts all L2 code requests. +.It Li L2_RQSTS.PF_HIT +.Pq Event 24H , Umask 40H +Counts all L2 HW prefetcher requests that hit L2. +.It Li L2_RQSTS.PF_MISS +.Pq Event 24H , Umask 80H +Counts all L2 HW prefetcher requests that missed L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask C0H +Counts all L2 HW prefetcher requests. +.It Li L2_STORE_LOCK_RQSTS.MISS +.Pq Event 27H , Umask 01H +RFOs that miss cache lines. +.It Li L2_STORE_LOCK_RQSTS.HIT_M +.Pq Event 27H , Umask 08H +RFOs that hit cache lines in M state. +.It Li L2_STORE_LOCK_RQSTS.ALL +.Pq Event 27H , Umask 0FH +RFOs that access cache lines in any state. +.It Li L2_L1D_WB_RQSTS.MISS +.Pq Event 28H , Umask 01H +Not rejected writebacks that missed LLC. +.It Li L2_L1D_WB_RQSTS.HIT_E +.Pq Event 28H , Umask 04H +Not rejected writebacks from L1D to L2 cache lines in E state. +.It Li L2_L1D_WB_RQSTS.HIT_M +.Pq Event 28H , Umask 08H +Not rejected writebacks from L1D to L2 cache lines in M state. +.It Li L2_L1D_WB_RQSTS.ALL +.Pq Event 28H , Umask 0FH +Not rejected writebacks from L1D to L2 cache lines in any state. +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the core that reference a cache +line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for references to the last level +cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the thread is not in a halt state. +The thread enters the halt state when it is running the HLT instruction. The +core frequency may change from time to time due to power or thermal +throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses every cycle. Set Cmaks = 1 +and Edge =1 to count occurrences. +Counter 2 only. +Set Cmask = 1 to count cycles. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 02H +Miss in all TLB levels causes a page walk that completes of any page size +(4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 04H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 10H +Store operations that miss the first TLB level but hit the second and do not +cause page walks. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Non-SW-prefetch load dispatches that hit fill buffer allocated for S/W prefetch. +.It Li LOAD_HIT_PRE.HW_PF +.Pq Event 4CH , Umask 02H +Non-SW-prefetch load dispatches that hit fill buffer allocated for H/W prefetch. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the L1 data cache. +.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED +.Pq Event 58H , Umask 01H +Number of integer Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.SIMD_NOT_ELIMINATED +.Pq Event 58H , Umask 02H +Number of SIMD Move Elimination candidate uops that were not eliminated. +.It Li MOVE_ELIMINATION.INT_ELIMINATED +.Pq Event 58H , Umask 04H +Number of integer Move Elimination candidate uops that were eliminated. +.It Li MOVE_ELIMINATION.SIMD_ELIMINATED +.Pq Event 58H , Umask 08H +Number of SIMD Move Elimination candidate uops that were eliminated. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is in ring 0. +Use Edge to count transition. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is not in ring 0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li DTLB_LOAD_MISSES.STLB_HIT +.Pq Event 5FH , Umask 04H +Counts load operations that missed 1st level DTLB but hit the 2nd level. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CODE_RD +.Pq Event 60H , Umask 02H +Offcore outstanding Demand Code Read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to uncore. Set Cmask=1 to +count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read transactions in SQ to uncore. Set +Cmask=1 to count cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ from MITE path. +Can combine Umask 04H and 20H. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ from DSB path. +Can combine Umask 08H and 10H +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ when MS_busy by DSB. Set +Cmask = 1 to count cycles. Add Edge=1 to count # of delivery. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +Increment each cycle # of uops delivered to IDQ when MS_busy by MITE. Set +Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ from MS by either DSB or +MITE. Set Cmask = 1 to count cycles. +Can combine Umask 04H, 08H. +.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_DSB_CYCLES_4_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered four uops. Set Cmask = 4. +.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered at least one uops. Set Cmask = 1. +.It Li IDQ.ALL_MITE_CYCLES_4_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered four uops. Set Cmask = 4. +.It Li IDQ.MITE_ALL_UOPS +.Pq Event 79H , Umask 3CH +# of uops delivered to IDQ from any path. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and Victim Cache Misses. +Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in all ITLB levels that cause page walks. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 02H +Misses in all ITLB levels that cause completed page walks. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 04H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 10H +Number of cache load STLB hits. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions executed, but not necessarily +retired. +Must combine with umask 40H, 80H. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions excluding calls and +indirect branches. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions that are not calls nor +returns. +Must combine with umask 80H. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, excluding non call +branch, executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register and memory indirect, +executed. +Must combine with umask 80H. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must combine with 01H,02H, 04H, 08H, +10H, 20H. +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions mispredicted. +Must combine with umask 40H, 80H. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch instructions that are not calls +nor returns. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that have a return mnemonic. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch instructions, excluding +non call branch, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including both register and memory +indirect, executed. +Must combine with umask 80H. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches executed. +Applicable to umask 01H only. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. Must combine with +01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per thread. +Use Cmask to qualify uop b/w. +.It Li UOPS_DISPATCHED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0. +.It Li UOPS_DISPATCHED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1. +.It Li UOPS_DISPATCHED_PORT.PORT_2_LD +.Pq Event A1H , Umask 04H +Cycles which a load uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2_STA +.Pq Event A1H , Umask 08H +Cycles which a store address uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_2 +.Pq Event A1H , Umask 0CH +Cycles which a Uop is dispatched on port 2. +.It Li UOPS_DISPATCHED_PORT.PORT_3_LD +.Pq Event A1H , Umask 10H +Cycles which a load uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3_STA +.Pq Event A1H , Umask 20H +Cycles which a store address uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_3 +.Pq Event A1H , Umask 30H +Cycles which a Uop is dispatched on port 3. +.It Li UOPS_DISPATCHED_PORT.PORT_4 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 4. +.It Li UOPS_DISPATCHED_PORT.PORT_5 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 5. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related reason. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available. (not including draining +form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.Pq Event A3H , Umask 01H +Cycles with pending L2 miss loads. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_LDM_PENDING +.Pq Event A3H , Umask 02H +Cycles with pending memory loads. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_NO_EXECUTE +.Pq Event A3H , Umask 04H +Cycles of dispatch stalls. Set AnyThread to count per core. +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.Pq Event A3H , Umask 08H +Cycles with pending L1 cache miss loads. Set AnyThread to count per core. +.It Li DSB2MITE_SWITCHES.COUNT +.Pq Event ABH , Umask 01H +Number of DSB to MITE switches. +.It Li DSB2MITE_SWITCHES.PENALTY_CYCLES +.Pq Event ABH , Umask 02H +Cycles DSB to MITE switches caused delay. +.It Li DSB_FILL.EXCEED_DSB_LINES +.Pq Event ACH , Umask 08H +DSB Fill encountered > 3 DSB lines. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes 4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD +.Pq Event B0H , Umask 02H +Demand code read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including regular RFOs, locks, +ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and prefetch). +.It Li UOPS_EXECUTED.THREAD +.Pq Event B1H , Umask 01H +Counts total number of uops to be executed per-thread each cycle. Set Cmask += 1, INV =1 to count stall cycles. +.It Li UOPS_EXECUTED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be executed per-core each cycle. +Do not need to set ANY. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Off-core Response Performance Monitoring. +PMC0 only. +Requires programming MSR 01A6H. +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +Off-core Response Performance Monitoring. +PMC3 only. +Requires programming MSR 01A7H. +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread- specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce effect of PEBS shadow in +IP distribution. +PMC1 only. +Must quiesce other PMCs. +.It Li OTHER_ASSISTS.AVX_STORE +.Pq Event C1H , Umask 08H +Number of assists associated with 256-bit AVX store operations. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 10H +Number of transitions from AVX- 256 to legacy SSE when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 20H +Number of transitions from SSE to AVX-256 when penalty applicable. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use cmask=1 and invert to count +active cycles or stalled cycles. +Supports PEBS, use Any=1 for core granular. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to memory order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Number of self-modifying-code machine clears detected. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load operations that refer to an +illegal address range with the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch instructions retired. +Supports PEBS. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +Supports PEBS. +.It Li BR_MISP_RETIRED.NEAR_CALL +.Pq Event C5H , Umask 02H +Direct and indirect mispredicted near call instructions retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li BR_MISP_RETIRED.NOT_TAKEN +.Pq Event C5H , Umask 10H +Mispredicted not taken branch instructions retired. +.It Li BR_MISP_RETIRED.TAKEN +.Pq Event C5H , Umask 20H +Mispredicted taken branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 FP assists due to Output values. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 FP assists due to input values. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H +Number of SIMD FP assists due to Output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY +.Pq Event CAH , Umask 1EH +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Sample loads with specified latency threshold. +PMC3 only. +Specify threshold in MSR 0x3F6. +.It Li MEM_TRANS_RETIRED.PRECISE_STORE +.Pq Event CDH , Umask 02H +Sample stores and collect precise store operation via PEBS record. +PMC3 only. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 01H +Qualify retired memory uops that are loads. Combine with umask 10H, 20H, +40H, 80H. +Supports PEBS. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. Combine with umask 10H, 20H, +40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask 10H +Qualify retired memory uops with STLB miss. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask 20H +Qualify retired memory uops with lock. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_UOP_RETIRED.SPLIT +.Pq Event D0H , Umask 40H +Qualify retired memory uops with line split. Must combine with umask 01H, +02H, to produce counts. +.It Li MEM_UOP_RETIRED.ALL +.Pq Event D0H , Umask 80H +Qualify any retired memory uops. Must combine with umask 01H, 02H, to +produce counts. +.It Li MEM_LOAD_UOPS_RETIRED.L1_HIT +.Pq Event D1H , Umask 01H +Retired load uops with L1 cache hits as data sources. +Supports PEBS. +.It Li MEM_LOAD_UOPS_RETIRED.L2_HIT +.Pq Event D1H , Umask 02H +Retired load uops with L2 cache hits as data sources. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_HIT +.Pq Event D1H , Umask 04H +Retired load uops whose data source was LLC hit with no snoop required. +.It Li MEM_LOAD_UOPS_RETIRED.LLC_MISS +.Pq Event D1H , Umask 20H +Retired load uops whose data source is LLC miss. +.It Li MEM_LOAD_UOPS_RETIRED.HIT_LFB +.Pq Event D1H , Umask 40H +Retired load uops which data sources were load uops missed L1 but hit FB due +to preceding miss to the same cache line with data not ready. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS +.Pq Event D2H , Umask 01H +Retired load uops which data sources were LLC hit and cross-core snoop +missed in on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT +.Pq Event D2H , Umask 02H +Retired load uops which data sources were LLC and cross-core snoop hits in +on-pkg core cache. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM +.Pq Event D2H , Umask 04H +Retired load uops which data sources were HitM responses from shared LLC. +.It Li MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_NONE +.Pq Event D2H , Umask 08H +Retired load uops which data sources were hits in LLC without snoops +required. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM +.Pq Event D3H , Umask 01H +Retired load uops which data sources missed LLC but serviced from local +dram. +Supports PEBS. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_DRAM +.Pq Event D3H , Umask 04H +Retired load uops whose data source was remote DRAM. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_HITM +.Pq Event D3H , Umask 10H +Retired load uops whose data source was remote HITM. +.It Li MEM_LOAD_UOPS_LLC_MISS_RETIRED.REMOTE_FWD +.Pq Event D3H , Umask 20H +Retired load uops whose data source was forwards from a remote cache. +.It Li BACLEARS.ANY +.Pq Event E6H , Umask 1FH +Number of front end re-steers due to BPU misprediction. +.It Li L2_TRANS.DEMAND_DATA_RD +.Pq Event F0H , Umask 01H +Demand Data Read requests that access L2 cache. +.It Li L2_TRANS.RFO +.Pq Event F0H , Umask 02H +RFO requests that access L2 cache. +.It Li L2_TRANS.CODE_RD +.Pq Event F0H , Umask 04H +L2 cache accesses when fetching instructions. +.It Li L2_TRANS.ALL_PF +.Pq Event F0H , Umask 08H +Any MLC or LLC HW prefetch accessing L2, including rejects. +.It Li L2_TRANS.L1D_WB +.Pq Event F0H , Umask 10H +L1D writebacks that access L2 cache. +.It Li L2_TRANS.L2_FILL +.Pq Event F0H , Umask 20H +L2 fill requests that access L2 cache. +.It Li L2_TRANS.L2_WB +.Pq Event F0H , Umask 40H +L2 writebacks that access L2 cache. +.It Li L2_TRANS.ALL_REQUESTS +.Pq Event F0H , Umask 80H +Transactions accessing L2 pipe. +.It Li L2_LINES_IN.I +.Pq Event F1H , Umask 01H +L2 cache lines in I state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.S +.Pq Event F1H , Umask 02H +L2 cache lines in S state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.E +.Pq Event F1H , Umask 04H +L2 cache lines in E state filling L2. +Counting does not cover rejects. +.It Li L2_LINES_IN.ALL +.Pq Event F1H , Umask 07H +L2 cache lines filling L2. +Counting does not cover rejects. +.It Li L2_LINES_OUT.DEMAND_CLEAN +.Pq Event F2H , Umask 01H +Clean L2 cache lines evicted by demand. +.It Li L2_LINES_OUT.DEMAND_DIRTY +.Pq Event F2H , Umask 02H +Dirty L2 cache lines evicted by demand. +.It Li L2_LINES_OUT.PF_CLEAN +.Pq Event F2H , Umask 04H +Clean L2 cache lines evicted by the MLC prefetcher. +.It Li L2_LINES_OUT.PF_DIRTY +.Pq Event F2H , Umask 08H +Dirty L2 cache lines evicted by the MLC prefetcher. +.It Li L2_LINES_OUT.DIRTY_ALL +.Pq Event F2H , Umask 0AH +Dirty L2 cache lines filling the L2. +.El +.Sh SEE ALSO +.Xr pmc 3 , +.Xr pmc.atom 3 , +.Xr pmc.core 3 , +.Xr pmc.iaf 3 , +.Xr pmc.ucf 3 , +.Xr pmc.k7 3 , +.Xr pmc.k8 3 , +.Xr pmc.p4 3 , +.Xr pmc.p5 3 , +.Xr pmc.p6 3 , +.Xr pmc.corei7 3 , +.Xr pmc.corei7uc 3 , +.Xr pmc.ivybridge 3 , +.Xr pmc.sandybridge 3 , +.Xr pmc.sandybridgeuc 3 , +.Xr pmc.sandybridgexeon 3 , +.Xr pmc.westmere 3 , +.Xr pmc.westmereuc 3 , +.Xr pmc.soft 3 , +.Xr pmc.tsc 3 , +.Xr pmc_cpuinfo 3 , +.Xr pmclog 3 , +.Xr hwpmc 4 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 05:00:42 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F36BF290; Mon, 15 Apr 2013 05:00:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1B9719E; Mon, 15 Apr 2013 05:00:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F50fxM076966; Mon, 15 Apr 2013 05:00:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F50fDg076965; Mon, 15 Apr 2013 05:00:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201304150500.r3F50fDg076965@svn.freebsd.org> From: Xin LI Date: Mon, 15 Apr 2013 05:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249494 - stable/9/release/doc/en_US.ISO8859-1/hardware X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 05:00:42 -0000 Author: delphij Date: Mon Apr 15 05:00:41 2013 New Revision: 249494 URL: http://svnweb.freebsd.org/changeset/base/249494 Log: MFC r249397: Fix a few typos. Reviewed by: gjb Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Directory Properties: stable/9/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 04:16:12 2013 (r249493) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.xml Mon Apr 15 05:00:41 2013 (r249494) @@ -171,7 +171,7 @@ There is a wide variety of motherboards available for this architecture. Motherboards using the ISA, VLB, EISA, AGP, and - PCI expansion busses are well-supported. There is some + PCI expansion buses are well-supported. There is some limited support for the MCA (MicroChannel) expansion bus used in the IBM PS/2 line of PCs. @@ -200,7 +200,7 @@ memory above 4 gigabytes and allow it to be used by the system. This feature places constraints on the device drivers and other features of &os; which may be used; consult the - &man.pae.4; manpage for more details. + &man.pae.4; manual page for more details. &os; will generally run on i386-based laptops, albeit with varying levels of support for certain hardware features such @@ -533,7 +533,7 @@ The following systems are partially supported by &os;. In - particular the fibre channel controllers in SBus-based systems are not + particular the fiber channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI and Sun FAS366 Fast-Wide SCSI controllers). From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 07:01:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4AB0FC6E; Mon, 15 Apr 2013 07:01:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C865845; Mon, 15 Apr 2013 07:01:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3F71MaA013907; Mon, 15 Apr 2013 07:01:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3F71LI5013899; Mon, 15 Apr 2013 07:01:21 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201304150701.r3F71LI5013899@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 15 Apr 2013 07:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249503 - in stable/9: . share/examples share/examples/cvsup X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 07:01:22 -0000 Author: bapt Date: Mon Apr 15 07:01:20 2013 New Revision: 249503 URL: http://svnweb.freebsd.org/changeset/base/249503 Log: MFC: r248151, r248168 Ports are no more exported via cvsup, remove cvsup examples and documentation refering to ports Deleted: stable/9/share/examples/cvsup/ports-supfile stable/9/share/examples/cvsup/refuse stable/9/share/examples/cvsup/refuse.README Modified: stable/9/ObsoleteFiles.inc stable/9/share/examples/Makefile stable/9/share/examples/cvsup/README stable/9/share/examples/cvsup/cvs-supfile stable/9/share/examples/cvsup/stable-supfile Directory Properties: stable/9/share/examples/ (props changed) stable/9/share/examples/cvsup/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/ObsoleteFiles.inc Mon Apr 15 07:01:20 2013 (r249503) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20130415: Ports are no more available via cvsup +OLD_FILES+=usr/share/examples/cvsup/ports-supfile +OLD_FILES+=usr/share/examples/cvsup/refuse +OLD_FILES+=usr/share/examples/cvsup/refuse.README # 20130315: removed long unused directories for .1aout section manpages OLD_FILES+=usr/share/man/en.ISO8859-1/man1aout OLD_FILES+=usr/share/man/en.UTF-8/man1aout Modified: stable/9/share/examples/Makefile ============================================================================== --- stable/9/share/examples/Makefile Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/Makefile Mon Apr 15 07:01:20 2013 (r249503) @@ -54,9 +54,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ cvsup/README \ cvsup/cvs-supfile \ cvsup/gnats-supfile \ - cvsup/ports-supfile \ - cvsup/refuse \ - cvsup/refuse.README \ cvsup/stable-supfile \ cvsup/standard-supfile \ diskless/ME \ Modified: stable/9/share/examples/cvsup/README ============================================================================== --- stable/9/share/examples/cvsup/README Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/cvsup/README Mon Apr 15 07:01:20 2013 (r249503) @@ -9,8 +9,6 @@ To maintain the sources for the FreeBSD- standard-supfile Main source tree - ports-supfile Ports collection - To maintain the sources for the FreeBSD-stable release, use: stable-supfile Main source tree @@ -18,7 +16,7 @@ To maintain the sources for the FreeBSD- To maintain a copy of the CVS repository containing all versions of FreeBSD, use: - cvs-supfile Main source tree and ports collection + cvs-supfile Main source tree collection To maintain a copy of the FreeBSD bug database, use the file: Modified: stable/9/share/examples/cvsup/cvs-supfile ============================================================================== --- stable/9/share/examples/cvsup/cvs-supfile Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/cvsup/cvs-supfile Mon Apr 15 07:01:20 2013 (r249503) @@ -36,9 +36,8 @@ # prefix=/home/ncvs # This specifies where to place the requested files. A # setting of "/home/ncvs" will place all of the files -# requested in /home/ncvs (e.g., "/home/ncvs/src/bin", -# "/home/ncvs/ports/archivers"). The prefix directory -# must exist in order to run CVSup. +# requested in /home/ncvs (e.g., "/home/ncvs/src/bin"). +# The prefix directory must exist in order to run CVSup. # Defaults that apply to all the collections # @@ -91,84 +90,6 @@ src-all #src-secure #src-sys-crypto -## Ports Collection. -# -# The easiest way to get the ports tree is to use the "ports-all" -# mega-collection. It includes all of the individual "ports-*" -# collections, -ports-all - -# These are the individual collections that make up "ports-all". If you -# use these, be sure to comment out "ports-all" above and always include -# "ports-base" if you use any of the other individual collections below. -# Your ports may not build correctly without an up-to-date "ports-base". -# -#ports-base -# -#ports-accessibility -#ports-arabic -#ports-archivers -#ports-astro -#ports-audio -#ports-benchmarks -#ports-biology -#ports-cad -#ports-chinese -#ports-comms -#ports-converters -#ports-databases -#ports-deskutils -#ports-devel -#ports-dns -#ports-editors -#ports-emulators -#ports-finance -#ports-french -#ports-ftp -#ports-games -#ports-german -#ports-graphics -#ports-hebrew -#ports-hungarian -#ports-irc -#ports-japanese -#ports-java -#ports-korean -#ports-lang -#ports-mail -#ports-math -#ports-misc -#ports-multimedia -#ports-net -#ports-net-im -#ports-net-mgmt -#ports-net-p2p -#ports-news -#ports-palm -#ports-picobsd -#ports-polish -#ports-ports-mgmt -#ports-portuguese -#ports-print -#ports-russian -#ports-science -#ports-security -#ports-shells -#ports-sysutils -#ports-textproc -#ports-ukrainian -#ports-vietnamese -#ports-www -#ports-x11 -#ports-x11-clocks -#ports-x11-drivers -#ports-x11-fm -#ports-x11-fonts -#ports-x11-servers -#ports-x11-themes -#ports-x11-toolkits -#ports-x11-wm - ## Projects # # This collection retrieves the projects tree of the FreeBSD @@ -186,4 +107,3 @@ cvsroot-all # directories merged into one, and merged commitlogs via symlinks. #cvsroot-common #cvsroot-src -#cvsroot-ports Modified: stable/9/share/examples/cvsup/stable-supfile ============================================================================== --- stable/9/share/examples/cvsup/stable-supfile Mon Apr 15 06:12:00 2013 (r249502) +++ stable/9/share/examples/cvsup/stable-supfile Mon Apr 15 07:01:20 2013 (r249503) @@ -39,21 +39,6 @@ # in "/usr/src" (e.g., "/usr/src/bin", "/usr/src/lib"). # The prefix directory must exist in order to run CVSup. # -############################################################################### -# -# DANGER! WARNING! LOOK OUT! VORSICHT! -# -# If you add any of the ports collections to this file, be sure to -# specify them with a "tag" value set to ".", like this: -# -# ports-all tag=. -# -# If you leave out the "tag=." portion, CVSup will delete all of -# the files in your ports. That is because the ports -# collections do not use the same tags as the main part of the FreeBSD -# source tree. -# -############################################################################### # Defaults that apply to all the collections # From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 17:16:14 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4F4CA05; Mon, 15 Apr 2013 17:16:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C703CF5D; Mon, 15 Apr 2013 17:16:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHGEuY000614; Mon, 15 Apr 2013 17:16:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHGCdT000602; Mon, 15 Apr 2013 17:16:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151716.r3FHGCdT000602@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249510 - in stable/9: share/man/man4 sys/cam/ctl sys/modules sys/modules/ctl usr.bin/ctlstat usr.sbin/ctladm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:16:15 -0000 Author: trasz Date: Mon Apr 15 17:16:12 2013 New Revision: 249510 URL: http://svnweb.freebsd.org/changeset/base/249510 Log: MFC r249009: Make it possible to build CTL as a module. MFC r249022 by glebius@: - Remove extra $FreeBSD$ - Touch options headers to make module buildable. Added: stable/9/share/man/man4/ctl.4 - copied unchanged from r249009, head/share/man/man4/ctl.4 stable/9/sys/modules/ctl/ - copied from r249009, head/sys/modules/ctl/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/cam/ctl/README.ctl.txt stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c stable/9/sys/cam/ctl/ctl_frontend_internal.c stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/modules/Makefile stable/9/sys/modules/ctl/Makefile stable/9/usr.bin/ctlstat/ctlstat.8 stable/9/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.bin/ctlstat/ (props changed) stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/share/man/man4/Makefile Mon Apr 15 17:16:12 2013 (r249510) @@ -93,6 +93,7 @@ MAN= aac.4 \ ${_cpuctl.4} \ cpufreq.4 \ crypto.4 \ + ctl.4 \ cue.4 \ cxgb.4 \ cxgbe.4 \ Copied: stable/9/share/man/man4/ctl.4 (from r249009, head/share/man/man4/ctl.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/ctl.4 Mon Apr 15 17:16:12 2013 (r249510, copy of r249009, head/share/man/man4/ctl.4) @@ -0,0 +1,90 @@ +.\" Copyright (c) 2013 Edward Tomasz Napierala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.Dd March 8, 2013 +.Dt CTL 4 +.Os +.Sh NAME +.Nm ctl +.Nd CAM Target Layer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ctl" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ctl_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +subsystem provides SCSI disk and processor emulation. +It supports features such as: +.Pp +.Bl -bullet -compact +.It +Disk and processor device emulation +.It +Tagged queueing +.It +SCSI task attribute support (ordered, head of queue, simple tags) +.It +SCSI implicit command ordering support. +.It +Full task management support (abort, LUN reset, target reset, etc.) +.It +Support for multiple ports +.It +Support for multiple simultaneous initiators +.It +Support for multiple simultaneous backing stores +.It +Persistent reservation support +.It +Mode sense/select support +.It +Error injection support +.It +All I/O handled in-kernel, no userland context switch overhead +.El +.Sh SEE ALSO +.Xr ctladm 8 , +.Xr ctlstat 8 +.Sh HISTORY +The +.Nm +subsystem first appeared in +.Fx 9.1 . +.Sh AUTHORS +The +.Nm +subsystem was written by +.An Kenneth Merry Aq ken@FreeBSD.org . Modified: stable/9/sys/cam/ctl/README.ctl.txt ============================================================================== --- stable/9/sys/cam/ctl/README.ctl.txt Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/README.ctl.txt Mon Apr 15 17:16:12 2013 (r249510) @@ -227,9 +227,6 @@ Revision 1.2 Changes To Do List: ========== - - Make CTL buildable as a module. Work needs to be done on initialization, - and on freeing resources and LUNs when it is built as a module. - - Use devstat(9) for CTL's statistics collection. CTL uses a home-grown statistics collection system that is similar to devstat(9). ctlstat should be retired in favor of iostat, etc., once aggregation modes are Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:16:12 2013 (r249510) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -332,7 +333,7 @@ TUNABLE_INT("kern.cam.ctl.disable", &ctl static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, int param); static void ctl_copy_sense_data(union ctl_ha_msg *src, union ctl_io *dest); -static void ctl_init(void); +static int ctl_init(void); void ctl_shutdown(void); static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); @@ -451,11 +452,16 @@ static struct cdevsw ctl_cdevsw = { MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL"); -/* - * If we have the CAM SIM, we may or may not have another SIM that will - * cause CTL to get initialized. If not, we need to initialize it. - */ -SYSINIT(ctl_init, SI_SUB_CONFIGURE, SI_ORDER_THIRD, ctl_init, NULL); +static int ctl_module_event_handler(module_t, int /*modeventtype_t*/, void *); + +static moduledata_t ctl_moduledata = { + "ctl", + ctl_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctl, ctl_moduledata, SI_SUB_CONFIGURE, SI_ORDER_THIRD); +MODULE_VERSION(ctl, 1); static void ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc, @@ -935,7 +941,7 @@ ctl_copy_sense_data(union ctl_ha_msg *sr dest->io_hdr.status = src->hdr.status; } -static void +static int ctl_init(void) { struct ctl_softc *softc; @@ -946,7 +952,7 @@ ctl_init(void) #if 0 int i; #endif - int retval; + int error, retval; //int isc_retval; retval = 0; @@ -955,7 +961,7 @@ ctl_init(void) /* If we're disabled, don't initialize. */ if (ctl_disable != 0) - return; + return (0); control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK | M_ZERO); @@ -984,7 +990,7 @@ ctl_init(void) destroy_dev(softc->dev); free(control_softc, M_DEVBUF); control_softc = NULL; - return; + return (ENOMEM); } SYSCTL_ADD_INT(&softc->sysctl_ctx, @@ -1046,7 +1052,7 @@ ctl_init(void) &internal_pool)!= 0){ printf("ctl: can't allocate %d entry internal pool, " "exiting\n", CTL_POOL_ENTRIES_INTERNAL); - return; + return (ENOMEM); } if (ctl_pool_create(softc, CTL_POOL_EMERGENCY, @@ -1054,7 +1060,7 @@ ctl_init(void) printf("ctl: can't allocate %d entry emergency pool, " "exiting\n", CTL_POOL_ENTRIES_EMERGENCY); ctl_pool_free(softc, internal_pool); - return; + return (ENOMEM); } if (ctl_pool_create(softc, CTL_POOL_4OTHERSC, CTL_POOL_ENTRIES_OTHER_SC, @@ -1064,7 +1070,7 @@ ctl_init(void) "exiting\n", CTL_POOL_ENTRIES_OTHER_SC); ctl_pool_free(softc, internal_pool); ctl_pool_free(softc, emergency_pool); - return; + return (ENOMEM); } softc->internal_pool = internal_pool; @@ -1085,14 +1091,15 @@ ctl_init(void) mtx_unlock(&softc->ctl_lock); #endif - if (kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, - "ctl_thrd") != 0) { + error = kproc_create(ctl_work_thread, softc, &softc->work_thread, 0, 0, + "ctl_thrd"); + if (error != 0) { printf("error creating CTL work thread!\n"); ctl_free_lun(lun); ctl_pool_free(softc, internal_pool); ctl_pool_free(softc, emergency_pool); ctl_pool_free(softc, other_pool); - return; + return (error); } printf("ctl: CAM Target Layer loaded\n"); @@ -1132,10 +1139,11 @@ ctl_init(void) if (sizeof(struct callout) > CTL_TIMER_BYTES) { printf("sizeof(struct callout) %zd > CTL_TIMER_BYTES %zd\n", sizeof(struct callout), CTL_TIMER_BYTES); - return; + return (EINVAL); } #endif /* CTL_IO_DELAY */ + return (0); } void @@ -1192,6 +1200,20 @@ ctl_shutdown(void) printf("ctl: CAM Target Layer unloaded\n"); } +static int +ctl_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + return (ctl_init()); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + /* * XXX KDM should we do some access checks here? Bump a reference count to * prevent a CTL module from being unloaded while someone has it open? Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Apr 15 17:16:12 2013 (r249510) @@ -121,12 +121,23 @@ struct cfcs_softc cfcs_softc; static int cfcs_max_sense = sizeof(struct scsi_sense_data); extern int ctl_disable; -SYSINIT(cfcs_init, SI_SUB_CONFIGURE, SI_ORDER_FOURTH, cfcs_init, NULL); SYSCTL_NODE(_kern_cam, OID_AUTO, ctl2cam, CTLFLAG_RD, 0, "CAM Target Layer SIM frontend"); SYSCTL_INT(_kern_cam_ctl2cam, OID_AUTO, max_sense, CTLFLAG_RW, &cfcs_max_sense, 0, "Maximum sense data size"); +static int cfcs_module_event_handler(module_t, int /*modeventtype_t*/, void *); + +static moduledata_t cfcs_moduledata = { + "ctlcfcs", + cfcs_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctlcfcs, cfcs_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); +MODULE_VERSION(ctlcfcs, 1); +MODULE_DEPEND(ctlcfi, ctl, 1, 1, 1); +MODULE_DEPEND(ctlcfi, cam, 1, 1, 1); int cfcs_init(void) @@ -176,7 +187,7 @@ cfcs_init(void) printf("%s: ctl_frontend_register() failed with error %d!\n", __func__, retval); mtx_destroy(&softc->lock); - return (1); + return (retval); } /* @@ -236,7 +247,7 @@ cfcs_init(void) CAM_LUN_WILDCARD) != CAM_REQ_CMP) { printf("%s: error creating path\n", __func__); xpt_bus_deregister(cam_sim_path(softc->sim)); - retval = 1; + retval = EINVAL; goto bailout; } @@ -274,6 +285,20 @@ cfcs_shutdown(void) } +static int +cfcs_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + return (cfcs_init()); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + static void cfcs_onoffline(void *arg, int online) { Modified: stable/9/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_internal.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/ctl_frontend_internal.c Mon Apr 15 17:16:12 2013 (r249510) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -189,7 +190,7 @@ MALLOC_DEFINE(M_CTL_CFI, "ctlcfi", "CTL static struct cfi_softc fetd_internal_softc; extern int ctl_disable; -void cfi_init(void); +int cfi_init(void); void cfi_shutdown(void) __unused; static void cfi_online(void *arg); static void cfi_offline(void *arg); @@ -217,9 +218,19 @@ static void cfi_metatask_io_done(union c static void cfi_err_recovery_done(union ctl_io *io); static void cfi_lun_io_done(union ctl_io *io); -SYSINIT(cfi_init, SI_SUB_CONFIGURE, SI_ORDER_FOURTH, cfi_init, NULL); +static int cfi_module_event_handler(module_t, int /*modeventtype_t*/, void *); -void +static moduledata_t cfi_moduledata = { + "ctlcfi", + cfi_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctlcfi, cfi_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); +MODULE_VERSION(ctlcfi, 1); +MODULE_DEPEND(ctlcfi, ctl, 1, 1, 1); + +int cfi_init(void) { struct cfi_softc *softc; @@ -234,7 +245,7 @@ cfi_init(void) /* If we're disabled, don't initialize */ if (ctl_disable != 0) - return; + return (0); if (sizeof(struct cfi_lun_io) > CTL_PORT_PRIV_SIZE) { printf("%s: size of struct cfi_lun_io %zd > " @@ -292,7 +303,7 @@ cfi_init(void) } bailout: - return; + return (0); bailout_error: @@ -309,6 +320,8 @@ bailout_error: default: break; } + + return (ENOMEM); } void @@ -331,6 +344,20 @@ cfi_shutdown(void) printf("%s: error shrinking LUN pool\n", __func__); } +static int +cfi_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + return (cfi_init()); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + static void cfi_online(void *arg) { Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:16:12 2013 (r249510) @@ -225,11 +225,28 @@ static struct periph_driver ctlfe_driver ctlfeinit, "ctl", TAILQ_HEAD_INITIALIZER(ctlfe_driver.units), /*generation*/ 0 }; -PERIPHDRIVER_DECLARE(ctl, ctlfe_driver); + +static int ctlfe_module_event_handler(module_t, int /*modeventtype_t*/, void *); + +/* + * We're not using PERIPHDRIVER_DECLARE(), because it runs at SI_SUB_DRIVERS, + * and that happens before CTL gets initialised. + */ +static moduledata_t ctlfe_moduledata = { + "ctlfe", + ctlfe_module_event_handler, + NULL +}; + +DECLARE_MODULE(ctlfe, ctlfe_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); +MODULE_VERSION(ctlfe, 1); +MODULE_DEPEND(ctlfe, ctl, 1, 1, 1); +MODULE_DEPEND(ctlfe, cam, 1, 1, 1); extern struct ctl_softc *control_softc; extern int ctl_disable; +#ifdef seems_unused int ctlfeinitialize(void) { @@ -257,6 +274,7 @@ ctlfeinitialize(void) return (0); } +#endif void ctlfeshutdown(void) @@ -288,6 +306,21 @@ ctlfeinit(void) } } +static int +ctlfe_module_event_handler(module_t mod, int what, void *arg) +{ + + switch (what) { + case MOD_LOAD: + periphdriver_register(&ctlfe_driver); + return (0); + case MOD_UNLOAD: + return (EBUSY); + default: + return (EOPNOTSUPP); + } +} + static void ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg) { @@ -1969,7 +2002,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i struct cam_sim *sim; cam_status status; - bus_softc = (struct ctlfe_softc *)arg; sim = bus_softc->sim; Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/sys/modules/Makefile Mon Apr 15 17:16:12 2013 (r249510) @@ -75,6 +75,7 @@ SUBDIR= \ ${_cryptodev} \ ${_cs} \ ${_ctau} \ + ctl \ ${_cxgb} \ cxgbe \ ${_cyclic} \ Modified: stable/9/sys/modules/ctl/Makefile ============================================================================== --- head/sys/modules/ctl/Makefile Tue Apr 2 09:42:42 2013 (r249009) +++ stable/9/sys/modules/ctl/Makefile Mon Apr 15 17:16:12 2013 (r249510) @@ -1,7 +1,5 @@ # $FreeBSD$ -# $FreeBSD$ - .PATH: ${.CURDIR}/../../cam/ctl KMOD= ctl @@ -22,5 +20,7 @@ SRCS+= scsi_ctl.c SRCS+= bus_if.h SRCS+= device_if.h SRCS+= vnode_if.h +SRCS+= opt_cam.h +SRCS+= opt_kdtrace.h .include Modified: stable/9/usr.bin/ctlstat/ctlstat.8 ============================================================================== --- stable/9/usr.bin/ctlstat/ctlstat.8 Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/usr.bin/ctlstat/ctlstat.8 Mon Apr 15 17:16:12 2013 (r249510) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.bin/ctlstat/ctlstat.8#2 $ .\" $FreeBSD$ .\" -.Dd June 4, 2010 +.Dd March 6, 2013 .Dt CTLSTAT 8 .Os .Sh NAME @@ -113,6 +113,7 @@ every 10 seconds. .Sh SEE ALSO .Xr cam 3 , .Xr cam 4 , +.Xr ctl 4 , .Xr xpt 4 , .Xr camcontrol 8 , .Xr ctladm 8 , Modified: stable/9/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 17:01:42 2013 (r249509) +++ stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 17:16:12 2013 (r249510) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd March 6, 2012 +.Dd March 6, 2013 .Dt CTLADM 8 .Os .Sh NAME @@ -978,6 +978,7 @@ This will result in a sense key of NOT R .Xr cam 3 , .Xr cam_cdbparse 3 , .Xr cam 4 , +.Xr ctl 4 , .Xr xpt 4 , .Xr camcontrol 8 .Sh HISTORY From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 17:19:29 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5CB08BA9; Mon, 15 Apr 2013 17:19:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F43CF86; Mon, 15 Apr 2013 17:19:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHJTFG001124; Mon, 15 Apr 2013 17:19:29 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHJTcu001122; Mon, 15 Apr 2013 17:19:29 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151719.r3FHJTcu001122@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:19:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249511 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:19:29 -0000 Author: trasz Date: Mon Apr 15 17:19:28 2013 New Revision: 249511 URL: http://svnweb.freebsd.org/changeset/base/249511 Log: MFC r249012: Remove unused code. Modified: stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:16:12 2013 (r249510) +++ stable/9/sys/cam/ctl/scsi_ctl.c Mon Apr 15 17:19:28 2013 (r249511) @@ -246,36 +246,6 @@ MODULE_DEPEND(ctlfe, cam, 1, 1, 1); extern struct ctl_softc *control_softc; extern int ctl_disable; -#ifdef seems_unused -int -ctlfeinitialize(void) -{ - cam_status status; - - /* Don't initialize if we're disabled */ - if (ctl_disable != 0) - return (0); - - STAILQ_INIT(&ctlfe_softc_list); - - mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); - - xpt_lock_buses(); - periphdriver_register(&ctlfe_driver); - xpt_unlock_buses(); - - status = xpt_register_async(AC_PATH_REGISTERED | AC_PATH_DEREGISTERED | - AC_CONTRACT, ctlfeasync, NULL, NULL); - - if (status != CAM_REQ_CMP) { - printf("ctl: Failed to attach async callback due to CAM " - "status 0x%x!\n", status); - } - - return (0); -} -#endif - void ctlfeshutdown(void) { From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 17:20:44 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 91AC1E37; Mon, 15 Apr 2013 17:20:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8470AF91; Mon, 15 Apr 2013 17:20:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHKiNp002879; Mon, 15 Apr 2013 17:20:44 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHKiro002878; Mon, 15 Apr 2013 17:20:44 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151720.r3FHKiro002878@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249513 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:20:44 -0000 Author: trasz Date: Mon Apr 15 17:20:44 2013 New Revision: 249513 URL: http://svnweb.freebsd.org/changeset/base/249513 Log: MFC r249019: Fix comment formatting. Modified: stable/9/sys/cam/ctl/ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:19:57 2013 (r249512) +++ stable/9/sys/cam/ctl/ctl.c Mon Apr 15 17:20:44 2013 (r249513) @@ -90,9 +90,9 @@ struct ctl_softc *control_softc = NULL; #define CTL_DONE_THREAD /* - * * Use the serial number and device ID provided by the backend, rather than - * * making up our own. - * */ + * Use the serial number and device ID provided by the backend, rather than + * making up our own. + */ #define CTL_USE_BACKEND_SN /* @@ -7874,7 +7874,7 @@ ctl_persistent_reserve_out(struct ctl_sc return (CTL_RETVAL_COMPLETE); } } else if ((cdb->action & SPRO_ACTION_MASK) != SPRO_REGISTER) { - /* + /* * We are not registered */ mtx_unlock(&softc->ctl_lock); From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 17:35:14 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BE2FB527; Mon, 15 Apr 2013 17:35:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96AD61051; Mon, 15 Apr 2013 17:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FHZEsW006837; Mon, 15 Apr 2013 17:35:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FHZEPr006836; Mon, 15 Apr 2013 17:35:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151735.r3FHZEPr006836@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 17:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249515 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 17:35:14 -0000 Author: trasz Date: Mon Apr 15 17:35:14 2013 New Revision: 249515 URL: http://svnweb.freebsd.org/changeset/base/249515 Log: MFC r249026: Don't directly dereference userland pointer; instead use kernel pointer copied in from userspace. This fixes instant panic when creating CTL LUN on sparc64. Not a security problem, since the API is root-only. Modified: stable/9/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Mon Apr 15 17:21:02 2013 (r249514) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Mon Apr 15 17:35:14 2013 (r249515) @@ -1671,7 +1671,7 @@ ctl_be_block_create(struct ctl_be_block_ if (be_lun->ctl_be_lun.lun_type == T_DIRECT) { for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].name, "file") == 0) { + if (strcmp(req->kern_be_args[i].kname, "file") == 0) { file_arg = &req->kern_be_args[i]; break; } @@ -1686,7 +1686,7 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->dev_path = malloc(file_arg->vallen, M_CTLBLK, M_WAITOK | M_ZERO); - strlcpy(be_lun->dev_path, (char *)file_arg->value, + strlcpy(be_lun->dev_path, (char *)file_arg->kvalue, file_arg->vallen); retval = ctl_be_block_open(softc, be_lun, req); @@ -1725,7 +1725,7 @@ ctl_be_block_create(struct ctl_be_block_ * the loop above, */ for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].name, "num_threads") == 0) { + if (strcmp(req->kern_be_args[i].kname, "num_threads") == 0) { struct ctl_be_arg *thread_arg; char num_thread_str[16]; int tmp_num_threads; @@ -1733,7 +1733,7 @@ ctl_be_block_create(struct ctl_be_block_ thread_arg = &req->kern_be_args[i]; - strlcpy(num_thread_str, (char *)thread_arg->value, + strlcpy(num_thread_str, (char *)thread_arg->kvalue, min(thread_arg->vallen, sizeof(num_thread_str))); From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 18:30:01 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DD08D426; Mon, 15 Apr 2013 18:30:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C12A71270; Mon, 15 Apr 2013 18:30:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIU18E023206; Mon, 15 Apr 2013 18:30:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIU1Hd023205; Mon, 15 Apr 2013 18:30:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304151830.r3FIU1Hd023205@svn.freebsd.org> From: Dimitry Andric Date: Mon, 15 Apr 2013 18:30:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249518 - stable/9/contrib/llvm/lib/Support X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:30:01 -0000 Author: dim Date: Mon Apr 15 18:30:00 2013 New Revision: 249518 URL: http://svnweb.freebsd.org/changeset/base/249518 Log: Pull in r178636 from upstream llvm trunk: Second pass at addressing PR15351 by explicitly checking for AVX support when getting the host processor information. It emits a .byte sequence on GNUC compilers to work around lack of xgetbv support with older assemblers, and resolves a comment typo found in the previous patch. This should fix crashes due to emitting of AVX instructions on certain processors, which do not support then, when using -march=native. This is a direct commit to stable/9, since head has a complete import of llvm/clang trunk, and there is no single commit to merge. Reported by: Kubilay Kocak Modified: stable/9/contrib/llvm/lib/Support/Host.cpp Modified: stable/9/contrib/llvm/lib/Support/Host.cpp ============================================================================== --- stable/9/contrib/llvm/lib/Support/Host.cpp Mon Apr 15 17:59:06 2013 (r249517) +++ stable/9/contrib/llvm/lib/Support/Host.cpp Mon Apr 15 18:30:00 2013 (r249518) @@ -111,6 +111,21 @@ static bool GetX86CpuIDAndInfo(unsigned #endif } +static bool OSHasAVXSupport() { +#if defined( __GNUC__ ) + // Check xgetbv; this uses a .byte sequence instead of the instruction + // directly because older assemblers do not include support for xgetbv and + // there is no easy way to conditionally compile based on the assembler used. + int rEAX, rEDX; + __asm__ (".byte 0x0f, 0x01, 0xd0" : "=a" (rEAX), "=d" (rEDX) : "c" (0)); +#elif defined(_MSC_VER) + unsigned long long rEAX = _xgetbv(_XCR_XFEATURE_ENABLED_MASK); +#else + int rEAX = 0; // Ensures we return false +#endif + return (rEAX & 6) == 6; +} + static void DetectX86FamilyModel(unsigned EAX, unsigned &Family, unsigned &Model) { Family = (EAX >> 8) & 0xf; // Bits 8 - 11 @@ -133,6 +148,10 @@ std::string sys::getHostCPUName() { DetectX86FamilyModel(EAX, Family, Model); bool HasSSE3 = (ECX & 0x1); + // If CPUID indicates support for XSAVE, XRESTORE and AVX, and XGETBV + // indicates that the AVX registers will be saved and restored on context + // switch, then we have full AVX support. + bool HasAVX = (ECX & ((1 << 28) | (1 << 27))) != 0 && OSHasAVXSupport(); GetX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX); bool Em64T = (EDX >> 29) & 0x1; @@ -242,11 +261,15 @@ std::string sys::getHostCPUName() { case 42: // Intel Core i7 processor. All processors are manufactured // using the 32 nm process. case 45: - return "corei7-avx"; + // Not all Sandy Bridge processors support AVX (such as the Pentium + // versions instead of the i7 versions). + return HasAVX ? "corei7-avx" : "corei7"; // Ivy Bridge: case 58: - return "core-avx-i"; + // Not all Ivy Bridge processors support AVX (such as the Pentium + // versions instead of the i7 versions). + return HasAVX ? "core-avx-i" : "corei7"; case 28: // Most 45 nm Intel Atom processors case 38: // 45 nm Atom Lincroft From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 18:32:36 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B14FA5C4; Mon, 15 Apr 2013 18:32:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3579128F; Mon, 15 Apr 2013 18:32:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIWan5025225; Mon, 15 Apr 2013 18:32:36 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIWakT025223; Mon, 15 Apr 2013 18:32:36 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304151832.r3FIWakT025223@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Apr 2013 18:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249519 - in stable/9: share/man/man4 usr.sbin/ctladm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:32:36 -0000 Author: trasz Date: Mon Apr 15 18:32:35 2013 New Revision: 249519 URL: http://svnweb.freebsd.org/changeset/base/249519 Log: MFC r249011: Fix dates in manual pages modified in 249009. Modified: stable/9/share/man/man4/ctl.4 stable/9/usr.sbin/ctladm/ctladm.8 Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/usr.sbin/ctladm/ (props changed) Modified: stable/9/share/man/man4/ctl.4 ============================================================================== --- stable/9/share/man/man4/ctl.4 Mon Apr 15 18:30:00 2013 (r249518) +++ stable/9/share/man/man4/ctl.4 Mon Apr 15 18:32:35 2013 (r249519) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 8, 2013 +.Dd April 2, 2013 .Dt CTL 4 .Os .Sh NAME Modified: stable/9/usr.sbin/ctladm/ctladm.8 ============================================================================== --- stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 18:30:00 2013 (r249518) +++ stable/9/usr.sbin/ctladm/ctladm.8 Mon Apr 15 18:32:35 2013 (r249519) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd March 6, 2013 +.Dd April 2, 2013 .Dt CTLADM 8 .Os .Sh NAME From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 18:38:22 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6E9318F5; Mon, 15 Apr 2013 18:38:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 472E212BC; Mon, 15 Apr 2013 18:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIcMb1026180; Mon, 15 Apr 2013 18:38:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIcMOt026179; Mon, 15 Apr 2013 18:38:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201304151838.r3FIcMOt026179@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 15 Apr 2013 18:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249521 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:38:22 -0000 Author: bapt Date: Mon Apr 15 18:38:21 2013 New Revision: 249521 URL: http://svnweb.freebsd.org/changeset/base/249521 Log: Fix mergeinfo after r249503 Submitted by: gavin Modified: Directory Properties: stable/9/ObsoleteFiles.inc (props changed) From owner-svn-src-stable-9@FreeBSD.ORG Mon Apr 15 18:56:03 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B86071C4; Mon, 15 Apr 2013 18:56:03 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA42B13A5; Mon, 15 Apr 2013 18:56:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3FIu3Qc031923; Mon, 15 Apr 2013 18:56:03 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3FIu3eX031922; Mon, 15 Apr 2013 18:56:03 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201304151856.r3FIu3eX031922@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 15 Apr 2013 18:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249522 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Apr 2013 18:56:03 -0000 Author: trociny Date: Mon Apr 15 18:56:03 2013 New Revision: 249522 URL: http://svnweb.freebsd.org/changeset/base/249522 Log: MFC r249240: Use pget(9) to reduce code duplication. Modified: stable/9/sys/kern/kern_descrip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Mon Apr 15 18:38:21 2013 (r249521) +++ stable/9/sys/kern/kern_descrip.c Mon Apr 15 18:56:03 2013 (r249522) @@ -3013,12 +3013,9 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE int vfslocked; name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - if ((error = p_candebug(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + if (error != 0) return (error); - } fdp = fdhold(p); PROC_UNLOCK(p); if (fdp == NULL) @@ -3330,12 +3327,9 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER cap_rights_t fd_cap_rights; name = (int *)arg1; - if ((p = pfind((pid_t)name[0])) == NULL) - return (ESRCH); - if ((error = p_candebug(curthread, p))) { - PROC_UNLOCK(p); + error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + if (error != 0) return (error); - } /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 04:24:46 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 966BFF5; Tue, 16 Apr 2013 04:24:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE1ABD9; Tue, 16 Apr 2013 04:24:46 +0000 (UTC) Received: from glenbarber.us (70.15.88.86.res-cmts.sewb.ptd.net [70.15.88.86]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id A694923F804; Tue, 16 Apr 2013 00:24:44 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.2 onyx.glenbarber.us A694923F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Tue, 16 Apr 2013 00:24:42 -0400 From: Glen Barber To: Edward Tomasz Napierala Subject: Re: svn commit: r249510 - in stable/9: share/man/man4 sys/cam/ctl sys/modules sys/modules/ctl usr.bin/ctlstat usr.sbin/ctladm Message-ID: <20130416042442.GI1553@glenbarber.us> References: <201304151716.r3FHGCdT000602@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="aFi3jz1oiPowsTUB" Content-Disposition: inline In-Reply-To: <201304151716.r3FHGCdT000602@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 04:24:46 -0000 --aFi3jz1oiPowsTUB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 15, 2013 at 05:16:12PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Apr 15 17:16:12 2013 > New Revision: 249510 > URL: http://svnweb.freebsd.org/changeset/base/249510 >=20 > Log: > MFC r249009: > =20 > Make it possible to build CTL as a module. > =20 > MFC r249022 by glebius@: > =20 > - Remove extra $FreeBSD$ > - Touch options headers to make module buildable. >=20 I think this commit has broken stable/9. Glen --aFi3jz1oiPowsTUB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRbNKKAAoJEFJPDDeguUajd7MH/i+mmOY5b3msKLKWep91rHke dT8u+hqht55Oo+KghlDywQwT2jpOmA/szEGAzAy+xnljJfFKjdbHuuJIF/W8ePbb W1vQUaVoco4IjxkR0qUcaKD02XyCrDuFQ4h8vYevzeyp+pMDH5Yw8hxKa/FhWknt 4S8n07FRVRU0tpiu5VEOmG51hHapMcVKkVrUYLGxp1EFxzP7TJ0dO6f3in2eoSL0 qkSwV1n/mv0yfmBuDneTZOMc+MJ57D4hW8XvKWEM0M/dre19N8m1kyuLm+2LNQoc nr97nL0kOlae34hW5Qyr5NhTsM3zA+MrVxcp8TRRxP9oQJUy7/nmmsFUdwlyG7g= =jEBq -----END PGP SIGNATURE----- --aFi3jz1oiPowsTUB-- From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 05:57:17 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15601A0A; Tue, 16 Apr 2013 05:57:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0523E24; Tue, 16 Apr 2013 05:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G5vGr9020536; Tue, 16 Apr 2013 05:57:16 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G5vGMs020535; Tue, 16 Apr 2013 05:57:16 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201304160557.r3G5vGMs020535@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 16 Apr 2013 05:57:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249530 - stable/9/sys/modules X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 05:57:17 -0000 Author: trasz Date: Tue Apr 16 05:57:16 2013 New Revision: 249530 URL: http://svnweb.freebsd.org/changeset/base/249530 Log: Disconnect the CTL module for now; it breaks i386 XEN. Modified: stable/9/sys/modules/Makefile Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Mon Apr 15 21:58:47 2013 (r249529) +++ stable/9/sys/modules/Makefile Tue Apr 16 05:57:16 2013 (r249530) @@ -75,7 +75,6 @@ SUBDIR= \ ${_cryptodev} \ ${_cs} \ ${_ctau} \ - ctl \ ${_cxgb} \ cxgbe \ ${_cyclic} \ From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 06:17:15 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E3410EA4; Tue, 16 Apr 2013 06:17:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D5F5EEBE; Tue, 16 Apr 2013 06:17:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6HFLo027129; Tue, 16 Apr 2013 06:17:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6HFZY027128; Tue, 16 Apr 2013 06:17:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304160617.r3G6HFZY027128@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Apr 2013 06:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249531 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:17:16 -0000 Author: kib Date: Tue Apr 16 06:17:15 2013 New Revision: 249531 URL: http://svnweb.freebsd.org/changeset/base/249531 Log: MFC r249303: Fix the assertions for the state of the object under the map entry with the MAP_ENTRY_VN_WRITECNT flag. Modified: stable/9/sys/vm/vm_map.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_map.c ============================================================================== --- stable/9/sys/vm/vm_map.c Tue Apr 16 05:57:16 2013 (r249530) +++ stable/9/sys/vm/vm_map.c Tue Apr 16 06:17:15 2013 (r249531) @@ -3160,6 +3160,22 @@ vmspace_fork(struct vmspace *vm1, vm_oof object->charge = old_entry->end - old_entry->start; old_entry->cred = NULL; } + + /* + * Assert the correct state of the vnode + * v_writecount while the object is locked, to + * not relock it later for the assertion + * correctness. + */ + if (old_entry->eflags & MAP_ENTRY_VN_WRITECNT && + object->type == OBJT_VNODE) { + KASSERT(((struct vnode *)object->handle)-> + v_writecount > 0, + ("vmspace_fork: v_writecount %p", object)); + KASSERT(object->un_pager.vnp.writemappings > 0, + ("vmspace_fork: vnp.writecount %p", + object)); + } VM_OBJECT_UNLOCK(object); /* @@ -3171,12 +3187,6 @@ vmspace_fork(struct vmspace *vm1, vm_oof MAP_ENTRY_IN_TRANSITION); new_entry->wired_count = 0; if (new_entry->eflags & MAP_ENTRY_VN_WRITECNT) { - object = new_entry->object.vm_object; - KASSERT(((struct vnode *)object->handle)-> - v_writecount > 0, - ("vmspace_fork: v_writecount")); - KASSERT(object->un_pager.vnp.writemappings > 0, - ("vmspace_fork: vnp.writecount")); vnode_pager_update_writecount(object, new_entry->start, new_entry->end); } From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 06:20:36 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63444C1; Tue, 16 Apr 2013 06:20:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52E2EED6; Tue, 16 Apr 2013 06:20:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6KauP029064; Tue, 16 Apr 2013 06:20:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6Kasa029062; Tue, 16 Apr 2013 06:20:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201304160620.r3G6Kasa029062@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 16 Apr 2013 06:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249532 - in stable/9/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:20:36 -0000 Author: kib Date: Tue Apr 16 06:20:35 2013 New Revision: 249532 URL: http://svnweb.freebsd.org/changeset/base/249532 Log: MFC r249439: Fix the name of the pcb member in the comments. Modified: stable/9/sys/amd64/amd64/support.S stable/9/sys/i386/i386/support.s Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/support.S ============================================================================== --- stable/9/sys/amd64/amd64/support.S Tue Apr 16 06:17:15 2013 (r249531) +++ stable/9/sys/amd64/amd64/support.S Tue Apr 16 06:20:35 2013 (r249532) @@ -200,9 +200,9 @@ END(fillw) * Access user memory from inside the kernel. These routines should be * the only places that do this. * - * These routines set curpcb->onfault for the time they execute. When a + * These routines set curpcb->pcb_onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler - * returns to *curpcb->onfault instead of the function. + * returns to *curpcb->pcb_onfault instead of the function. */ /* Modified: stable/9/sys/i386/i386/support.s ============================================================================== --- stable/9/sys/i386/i386/support.s Tue Apr 16 06:17:15 2013 (r249531) +++ stable/9/sys/i386/i386/support.s Tue Apr 16 06:20:35 2013 (r249532) @@ -262,9 +262,9 @@ END(memcpy) * write permissions when we are executing with EPL 0. The 486 does check * this if the WP bit is set in CR0, so we can use a simpler version here. * - * These routines set curpcb->onfault for the time they execute. When a + * These routines set curpcb->pcb_onfault for the time they execute. When a * protection violation occurs inside the functions, the trap handler - * returns to *curpcb->onfault instead of the function. + * returns to *curpcb->pcb_onfault instead of the function. */ /* From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 06:51:07 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8DEE594D; Tue, 16 Apr 2013 06:51:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80D9DFF0; Tue, 16 Apr 2013 06:51:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3G6p7Oa038185; Tue, 16 Apr 2013 06:51:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3G6p78P038184; Tue, 16 Apr 2013 06:51:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304160651.r3G6p78P038184@svn.freebsd.org> From: Dimitry Andric Date: Tue, 16 Apr 2013 06:51:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249534 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 06:51:07 -0000 Author: dim Date: Tue Apr 16 06:51:07 2013 New Revision: 249534 URL: http://svnweb.freebsd.org/changeset/base/249534 Log: MFC r249316: Ensure make -j N universe works correctly, by checking for an up-to-date make before starting the universe targets themselves. Otherwise, all of the targets would attempt to build make simultaneously, overwriting each other's copies of the make object files and executable. This could lead to strange errors, for example when partially-written make executables are invoked. Also amend r216620, to make the rest of universe wait properly until the upgrade_checks target is finished, by adding universe_${target}_prologue to the .ORDER target. Otherwise, make will be too smart for its own good, and start building the universe targets simultaneously with the prologues anyway. Modified: stable/9/Makefile (contents, props changed) Modified: stable/9/Makefile ============================================================================== --- stable/9/Makefile Tue Apr 16 06:21:57 2013 (r249533) +++ stable/9/Makefile Tue Apr 16 06:51:07 2013 (r249534) @@ -356,7 +356,7 @@ MAKEFAIL=tee -a ${FAILFILE} MAKEFAIL=cat .endif -universe: universe_prologue +universe: universe_prologue upgrade_checks universe_prologue: @echo "--------------------------------------------------------------" @echo ">>> make universe started on ${STARTTIME}" @@ -366,7 +366,7 @@ universe_prologue: .endif .for target in ${TARGETS} universe: universe_${target} -.ORDER: universe_prologue universe_${target} universe_epilogue +.ORDER: universe_prologue upgrade_checks universe_${target}_prologue universe_${target} universe_epilogue universe_${target}: universe_${target}_prologue universe_${target}_prologue: @echo ">> ${target} started on `LC_ALL=C date`" From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 16:09:28 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 919ABB1F; Tue, 16 Apr 2013 16:09:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 69997603; Tue, 16 Apr 2013 16:09:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GG9SKb009939; Tue, 16 Apr 2013 16:09:28 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GG9SID009937; Tue, 16 Apr 2013 16:09:28 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304161609.r3GG9SID009937@svn.freebsd.org> From: Brooks Davis Date: Tue, 16 Apr 2013 16:09:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:09:28 -0000 Author: brooks Date: Tue Apr 16 16:09:27 2013 New Revision: 249549 URL: http://svnweb.freebsd.org/changeset/base/249549 Log: MFC (much delayed) 234504: Enable DTrace hooks in GENERIC. Modified: stable/9/sys/amd64/conf/GENERIC stable/9/sys/i386/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) @@ -22,6 +22,7 @@ cpu HAMMER ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -#options KDTRACE_FRAME # Ensure frames are compiled in -#options KDTRACE_HOOKS # Kernel DTrace hooks +options KDTRACE_FRAME # Ensure frames are compiled in +options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel options KDB # Kernel debugger related code options KDB_TRACE # Print a stack trace for a panic +options DDB_CTF # kernel ELF linker loads CTF data # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) @@ -24,6 +24,7 @@ cpu I686_CPU ident GENERIC makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) options AUDIT # Security event auditing options MAC # TrustedBSD MAC Framework -#options KDTRACE_HOOKS # Kernel DTrace hooks +options KDTRACE_HOOKS # Kernel DTrace hooks options INCLUDE_CONFIG_FILE # Include this file in kernel options KDB # Kernel debugger related code options KDB_TRACE # Print a stack trace for a panic +options DDB_CTF # kernel ELF linker loads CTF data # To make an SMP kernel, the next two lines are needed options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 16:14:31 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66C35200; Tue, 16 Apr 2013 16:14:31 +0000 (UTC) (envelope-from prvs=18180aeca7=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 5B03E676; Tue, 16 Apr 2013 16:14:30 +0000 (UTC) Received: from r2d2 ([46.65.172.4]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50003302279.msg; Tue, 16 Apr 2013 17:14:23 +0100 X-Spam-Processed: mail1.multiplay.co.uk, Tue, 16 Apr 2013 17:14:23 +0100 (not processed: message from valid local sender) X-MDDKIM-Result: neutral (mail1.multiplay.co.uk) X-MDRemoteIP: 46.65.172.4 X-Return-Path: prvs=18180aeca7=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk Message-ID: <2F45DF711D81416BBAD8B24EAF8AFA36@multiplay.co.uk> From: "Steven Hartland" To: "Brooks Davis" , , , , References: <201304161609.r3GG9SID009937@svn.freebsd.org> Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Date: Tue, 16 Apr 2013 17:14:41 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:14:31 -0000 ----- Original Message ----- From: "Brooks Davis" > Author: brooks > Date: Tue Apr 16 16:09:27 2013 > New Revision: 249549 > URL: http://svnweb.freebsd.org/changeset/base/249549 > > Log: > MFC (much delayed) 234504: > > Enable DTrace hooks in GENERIC. > > Modified: > stable/9/sys/amd64/conf/GENERIC > stable/9/sys/i386/conf/GENERIC > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -22,6 +22,7 @@ cpu HAMMER > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_FRAME # Ensure frames are compiled in > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_FRAME # Ensure frames are compiled in > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # Make an SMP-capable kernel by default > options SMP # Symmetric MultiProcessor Kernel > > Modified: stable/9/sys/i386/conf/GENERIC > ============================================================================== > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -24,6 +24,7 @@ cpu I686_CPU > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # To make an SMP kernel, the next two lines are needed > options SMP # Symmetric MultiProcessor Kernel What's the performance / memory usage impact of enabling these by default? Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk. From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 16:19:21 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 68949841 for ; Tue, 16 Apr 2013 16:19:21 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta02.emeryville.ca.mail.comcast.net (qmta02.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:24]) by mx1.freebsd.org (Postfix) with ESMTP id 4EA646C6 for ; Tue, 16 Apr 2013 16:19:21 +0000 (UTC) Received: from omta01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by qmta02.emeryville.ca.mail.comcast.net with comcast id QeSv1l0030EPchoA2gKM5V; Tue, 16 Apr 2013 16:19:21 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta01.emeryville.ca.mail.comcast.net with comcast id QgKL1l0041t3BNj8MgKLn4; Tue, 16 Apr 2013 16:19:20 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id DEA0073A33; Tue, 16 Apr 2013 09:19:19 -0700 (PDT) Date: Tue, 16 Apr 2013 09:19:19 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130416161919.GA80626@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304161609.r3GG9SID009937@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366129161; bh=c39IGxW/Xm4Z0cLTIsn5919wyGaCl2zOjqsrEgA6gU8=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=TsWMpTeh3P9FeF2u9tCgCD1ym4drOyLZ0UmnkzfdspOm4HebSz7u6MxFAADURM5KW XQlep8xAPbnkNRJ23Csc5HAuksJDYVkyOT4ht9AcS9Z4uFLTp8VbrfUx0JlWtXnSCU ++xHn2JLoBaGpId6s795uno9jzx1FlpLVT2/TQZwnvPyKbmrAHRl9LPT90j2jFBvGe e3f9Z6dMkgiqeY468xUp+n8siFbguXkn/HnA37bjDfl6hYT3G9MRXZsKnD2jgesIDU GrcjzVw9IL4lmUSv70wctDCgp0M5CbuMFvhmo3plm3ueKzq6I9gB58CtAfp5Lt6r8y EXih+C9UQWR+Q== Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:19:21 -0000 On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Apr 16 16:09:27 2013 > New Revision: 249549 > URL: http://svnweb.freebsd.org/changeset/base/249549 > > Log: > MFC (much delayed) 234504: > > Enable DTrace hooks in GENERIC. > > Modified: > stable/9/sys/amd64/conf/GENERIC > stable/9/sys/i386/conf/GENERIC > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -22,6 +22,7 @@ cpu HAMMER > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_FRAME # Ensure frames are compiled in > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_FRAME # Ensure frames are compiled in > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # Make an SMP-capable kernel by default > options SMP # Symmetric MultiProcessor Kernel > > Modified: stable/9/sys/i386/conf/GENERIC > ============================================================================== > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -24,6 +24,7 @@ cpu I686_CPU > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # To make an SMP kernel, the next two lines are needed > options SMP # Symmetric MultiProcessor Kernel Now that this has been enabled by default, I should warn folks of a caveat that I found in the buildworld/buildkernel framework. It's easiest to explain like this: 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... 2. Add WITHOUT_CDDL=true to /etc/src.conf 3. Rebuild + install kernel/world per src/Makefile procedure 4. Remove WITHOUT_CDDL=true from /etc/src.conf 5. rm -fr /usr/obj/* 6. Rebuild world 7. Rebuild kernel -- fails, stating "ctfconvert: not found". For whatever reason the buildkernel bits make the assumption that ctfconvert exists on the system (presumably in $PATH or possibly a hard-coded), when ideally it should try to use the recently-built version in /usr/obj first. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 16:35:49 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5593DC4D; Tue, 16 Apr 2013 16:35:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37AB87B9; Tue, 16 Apr 2013 16:35:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GGZn3C019369; Tue, 16 Apr 2013 16:35:49 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GGZmaT019365; Tue, 16 Apr 2013 16:35:48 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201304161635.r3GGZmaT019365@svn.freebsd.org> From: Dimitry Andric Date: Tue, 16 Apr 2013 16:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249550 - in stable/9/sys: arm/xscale/ixp425 mips/atheros mips/rt305x X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:35:49 -0000 Author: dim Date: Tue Apr 16 16:35:48 2013 New Revision: 249550 URL: http://svnweb.freebsd.org/changeset/base/249550 Log: MFC r249449: Fix undefined behaviour in several gpio_pin_setflags() routines (under sys/arm and sys/mips), squelching the clang 3.3 warnings about this. Noticed by: tinderbox and many irate spectators Submitted by: Luiz Otavio O Souza PR: kern/177759 Modified: stable/9/sys/arm/xscale/ixp425/avila_gpio.c stable/9/sys/arm/xscale/ixp425/cambria_gpio.c stable/9/sys/mips/atheros/ar71xx_gpio.c stable/9/sys/mips/rt305x/rt305x_gpio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- stable/9/sys/arm/xscale/ixp425/avila_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/arm/xscale/ixp425/avila_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -220,8 +220,8 @@ avila_gpio_pin_setflags(device_t dev, ui if (pin >= IXP4XX_GPIO_PINS || !(sc->sc_valid & mask)) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_pins[pin].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: stable/9/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- stable/9/sys/arm/xscale/ixp425/cambria_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/arm/xscale/ixp425/cambria_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -317,8 +317,8 @@ cambria_gpio_pin_setflags(device_t dev, if (pin >= GPIO_PINS) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->sc_pins[pin].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->sc_pins[pin].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: stable/9/sys/mips/atheros/ar71xx_gpio.c ============================================================================== --- stable/9/sys/mips/atheros/ar71xx_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/mips/atheros/ar71xx_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -238,8 +238,8 @@ ar71xx_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ Modified: stable/9/sys/mips/rt305x/rt305x_gpio.c ============================================================================== --- stable/9/sys/mips/rt305x/rt305x_gpio.c Tue Apr 16 16:09:27 2013 (r249549) +++ stable/9/sys/mips/rt305x/rt305x_gpio.c Tue Apr 16 16:35:48 2013 (r249550) @@ -242,8 +242,8 @@ rt305x_gpio_pin_setflags(device_t dev, u if (i >= sc->gpio_npins) return (EINVAL); - /* Filter out unwanted flags */ - if ((flags &= sc->gpio_pins[i].gp_caps) != flags) + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) return (EINVAL); /* Can't mix input/output together */ From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 16:43:34 2013 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B6B1B1D2; Tue, 16 Apr 2013 16:43:34 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id EC9B3831; Tue, 16 Apr 2013 16:43:26 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3GGhVjF014722; Tue, 16 Apr 2013 11:43:31 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3GGhVsY014721; Tue, 16 Apr 2013 11:43:31 -0500 (CDT) (envelope-from brooks) Date: Tue, 16 Apr 2013 11:43:31 -0500 From: Brooks Davis To: Steven Hartland Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130416164331.GF98205@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <2F45DF711D81416BBAD8B24EAF8AFA36@multiplay.co.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ls2Gy6y7jbHLe9Od" Content-Disposition: inline In-Reply-To: <2F45DF711D81416BBAD8B24EAF8AFA36@multiplay.co.uk> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 16:43:34 -0000 --Ls2Gy6y7jbHLe9Od Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 16, 2013 at 05:14:41PM +0100, Steven Hartland wrote: > ----- Original Message -----=20 > From: "Brooks Davis" > > Author: brooks > > Date: Tue Apr 16 16:09:27 2013 > > New Revision: 249549 > > URL: http://svnweb.freebsd.org/changeset/base/249549 > >=20 > > Log: > > MFC (much delayed) 234504: > > =20 > > Enable DTrace hooks in GENERIC. > >=20 > > Modified: > > stable/9/sys/amd64/conf/GENERIC > > stable/9/sys/i386/conf/GENERIC > > Directory Properties: > > stable/9/sys/ (props changed) > >=20 > > Modified: stable/9/sys/amd64/conf/GENERIC > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > > @@ -22,6 +22,7 @@ cpu HAMMER > > ident GENERIC > >=20 > > makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols > > +makeoptions WITH_CTF=3D1 # Run ctfconvert(1) for DTrace support > >=20 > > options SCHED_ULE # ULE scheduler > > options PREEMPTION # Enable kernel thread preemption > > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > > options AUDIT # Security event auditing > > options MAC # TrustedBSD MAC Framework > > -#options KDTRACE_FRAME # Ensure frames are compiled in > > -#options KDTRACE_HOOKS # Kernel DTrace hooks > > +options KDTRACE_FRAME # Ensure frames are compiled in > > +options KDTRACE_HOOKS # Kernel DTrace hooks > > options INCLUDE_CONFIG_FILE # Include this file in kernel > > options KDB # Kernel debugger related code > > options KDB_TRACE # Print a stack trace for a panic > > +options DDB_CTF # kernel ELF linker loads CTF data > >=20 > > # Make an SMP-capable kernel by default > > options SMP # Symmetric MultiProcessor Kernel > >=20 > > Modified: stable/9/sys/i386/conf/GENERIC > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > > @@ -24,6 +24,7 @@ cpu I686_CPU > > ident GENERIC > >=20 > > makeoptions DEBUG=3D-g # Build kernel with gdb(1) debug symbols > > +makeoptions WITH_CTF=3D1 # Run ctfconvert(1) for DTrace support > >=20 > > options SCHED_ULE # ULE scheduler > > options PREEMPTION # Enable kernel thread preemption > > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > > options AUDIT # Security event auditing > > options MAC # TrustedBSD MAC Framework > > -#options KDTRACE_HOOKS # Kernel DTrace hooks > > +options KDTRACE_HOOKS # Kernel DTrace hooks > > options INCLUDE_CONFIG_FILE # Include this file in kernel > > options KDB # Kernel debugger related code > > options KDB_TRACE # Print a stack trace for a panic > > +options DDB_CTF # kernel ELF linker loads CTF data > >=20 > > # To make an SMP kernel, the next two lines are needed > > options SMP # Symmetric MultiProcessor Kernel >=20 > What's the performance / memory usage impact of enabling these > by default? The performance impact should be close to zero, but I've not attempted to measure it. Others who are using DTrace in production could probably comment more usefully. DDB_CTF causes the slightly less than 700KB SUNW_ctf section to be loaded into RAM that should be the majority of the overhead. -- Brooks --Ls2Gy6y7jbHLe9Od Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRbX+yXY6L6fI4GtQRAiT4AJ9NbF20hUhxQ2UGymuei0z8G7QFkACfcblM EPEUqDwksu6Jax7ksXmNea4= =3TlJ -----END PGP SIGNATURE----- --Ls2Gy6y7jbHLe9Od-- From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 19:27:10 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A2DA5999; Tue, 16 Apr 2013 19:27:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 838BF11B9; Tue, 16 Apr 2013 19:27:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJRAb7075036; Tue, 16 Apr 2013 19:27:10 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJR9Xt075029; Tue, 16 Apr 2013 19:27:09 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304161927.r3GJR9Xt075029@svn.freebsd.org> From: Brooks Davis Date: Tue, 16 Apr 2013 19:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249560 - in stable/9: contrib/libc-vis lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:27:10 -0000 Author: brooks Date: Tue Apr 16 19:27:09 2013 New Revision: 249560 URL: http://svnweb.freebsd.org/changeset/base/249560 Log: MFC r248302: Update to the latest (un)vis(3) sources from NetBSD. This adds multibyte support[0] and the new functions strenvisx and strsenvisx. Add MLINKS for vis(3) functions add by this and the initial import from NetBSD[1]. PR: bin/166364, bin/175418 Submitted by: "J.R. Oldroyd" [0] stefanf[1] Obtained from: NetBSD Modified: stable/9/contrib/libc-vis/unvis.3 stable/9/contrib/libc-vis/unvis.c stable/9/contrib/libc-vis/vis.3 stable/9/contrib/libc-vis/vis.c stable/9/contrib/libc-vis/vis.h stable/9/lib/libc/gen/Makefile.inc stable/9/lib/libc/gen/Symbol.map Directory Properties: stable/9/contrib/libc-vis/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/contrib/libc-vis/unvis.3 ============================================================================== --- stable/9/contrib/libc-vis/unvis.3 Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/unvis.3 Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -.\" $NetBSD: unvis.3,v 1.23 2011/03/17 14:06:29 wiz Exp $ +.\" $NetBSD: unvis.3,v 1.27 2012/12/15 07:34:36 wiz Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1989, 1991, 1993 @@ -126,15 +126,17 @@ The function has several return codes that must be handled properly. They are: .Bl -tag -width UNVIS_VALIDPUSH -.It Li \&0 (zero) +.It Li \&0 No (zero) Another character is necessary; nothing has been recognized yet. .It Dv UNVIS_VALID A valid character has been recognized and is available at the location -pointed to by cp. +pointed to by +.Fa cp . .It Dv UNVIS_VALIDPUSH A valid character has been recognized and is available at the location -pointed to by cp; however, the character currently passed in should -be passed in again. +pointed to by +.Fa cp ; +however, the character currently passed in should be passed in again. .It Dv UNVIS_NOCHAR A valid sequence was detected, but no character was produced. This return code is necessary to indicate a logical break between characters. @@ -150,7 +152,7 @@ one more time with flag set to to extract any remaining character (the character passed in is ignored). .Pp The -.Ar flag +.Fa flag argument is also used to specify the encoding style of the source. If set to .Dv VIS_HTTPSTYLE @@ -161,7 +163,8 @@ will decode URI strings as specified in If set to .Dv VIS_HTTP1866 , .Fn unvis -will decode URI strings as specified in RFC 1866. +will decode entity references and numeric character references +as specified in RFC 1866. If set to .Dv VIS_MIMESTYLE , .Fn unvis @@ -169,7 +172,9 @@ will decode MIME Quoted-Printable string If set to .Dv VIS_NOESCAPE , .Fn unvis -will not decode \e quoted characters. +will not decode +.Ql \e +quoted characters. .Pp The following code fragment illustrates a proper use of .Fn unvis . @@ -204,7 +209,7 @@ The functions and .Fn strnunvisx will return \-1 on error and set -.Va errno +.Va errno to: .Bl -tag -width Er .It Bq Er EINVAL @@ -212,7 +217,7 @@ An invalid escape sequence was detected, .El .Pp In addition the functions -.Fn strnunvis +.Fn strnunvis and .Fn strnunvisx will can also set @@ -244,4 +249,14 @@ and functions appeared in .Nx 6.0 and -.Fx 10.0 . +.Fx 9.2 . +.Sh BUGS +The names +.Dv VIS_HTTP1808 +and +.Dv VIS_HTTP1866 +are wrong. +Percent-encoding was defined in RFC 1738, the original RFC for URL. +RFC 1866 defines HTML 2.0, an application of SGML, from which it +inherits concepts of numeric character references and entity +references. Modified: stable/9/contrib/libc-vis/unvis.c ============================================================================== --- stable/9/contrib/libc-vis/unvis.c Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/unvis.c Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -/* $NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $ */ +/* $NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: unvis.c,v 1.40 2012/12/14 21:31:01 christos Exp $"); +__RCSID("$NetBSD: unvis.c,v 1.41 2012/12/15 04:29:53 matt Exp $"); #endif #endif /* LIBC_SCCS and not lint */ __FBSDID("$FreeBSD$"); @@ -90,7 +90,7 @@ __weak_alias(strnunvisx,_strnunvisx) * RFC 1866 */ static const struct nv { - const char name[7]; + char name[7]; uint8_t value; } nv[] = { { "AElig", 198 }, /* capital AE diphthong (ligature) */ Modified: stable/9/contrib/libc-vis/vis.3 ============================================================================== --- stable/9/contrib/libc-vis/vis.3 Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/vis.3 Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -.\" $NetBSD: vis.3,v 1.29 2012/12/14 22:55:59 christos Exp $ +.\" $NetBSD: vis.3,v 1.39 2013/02/20 20:05:26 christos Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1989, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)vis.3 8.1 (Berkeley) 6/9/93 .\" -.Dd December 14, 2012 +.Dd February 19, 2013 .Dt VIS 3 .Os .Sh NAME @@ -40,12 +40,14 @@ .Nm strnvis , .Nm strvisx , .Nm strnvisx , +.Nm strenvisx , .Nm svis , .Nm snvis , .Nm strsvis , .Nm strsnvis , -.Nm strsvisx -.Nm strsnvisx +.Nm strsvisx , +.Nm strsnvisx , +.Nm strsenvisx .Nd visually encode characters .Sh LIBRARY .Lb libc @@ -63,6 +65,8 @@ .Fn strvisx "char *dst" "const char *src" "size_t len" "int flag" .Ft int .Fn strnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" +.Ft int +.Fn strenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "int *cerr_ptr" .Ft char * .Fn svis "char *dst" "int c" "int flag" "int nextc" "const char *extra" .Ft char * @@ -75,6 +79,8 @@ .Fn strsvisx "char *dst" "const char *src" "size_t len" "int flag" "const char *extra" .Ft int .Fn strsnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" +.Ft int +.Fn strsenvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" "int *cerr_ptr" .Sh DESCRIPTION The .Fn vis @@ -89,11 +95,11 @@ needs no encoding, it is copied in unalt The string is null terminated, and a pointer to the end of the string is returned. The maximum length of any encoding is four -characters (not including the trailing +bytes (not including the trailing .Dv NUL ) ; thus, when encoding a set of characters into a buffer, the size of the buffer should -be four times the number of characters encoded, plus one for the trailing +be four times the number of bytes encoded, plus one for the trailing .Dv NUL . The flag parameter is used for altering the default range of characters considered for encoding and for altering the visual @@ -142,16 +148,17 @@ terminate The size of .Fa dst must be four times the number -of characters encoded from +of bytes encoded from .Fa src (plus one for the .Dv NUL ) . Both -forms return the number of characters in dst (not including -the trailing +forms return the number of characters in +.Fa dst +(not including the trailing .Dv NUL ) . The -.Dq n +.Dq Nm n versions of the functions also take an additional argument .Fa dlen that indicates the length of the @@ -159,7 +166,7 @@ that indicates the length of the buffer. If .Fa dlen -is not large enough to fix the converted string then the +is not large enough to fit the converted string then the .Fn strnvis and .Fn strnvisx @@ -167,6 +174,14 @@ functions return \-1 and set .Va errno to .Dv ENOSPC . +The +.Fn strenvisx +function takes an additional argument, +.Fa cerr_ptr , +that is used to pass in and out a multibyte conversion error flag. +This is useful when processing single characters at a time when +it is possible that the locale may be set to something other +than the locale of the characters in the input data. .Pp The functions .Fn svis , @@ -174,16 +189,18 @@ The functions .Fn strsvis , .Fn strsnvis , .Fn strsvisx , +.Fn strsnvisx , and -.Fn strsnvisx +.Fn strsenvisx correspond to .Fn vis , .Fn nvis , .Fn strvis , .Fn strnvis , .Fn strvisx , +.Fn strnvisx , and -.Fn strnvisx +.Fn strenvisx but have an additional argument .Fa extra , pointing to a @@ -214,14 +231,13 @@ and .Fn strnvisx ) , and the type of representation used. By default, all non-graphic characters, -except space, tab, and newline are encoded. -(See -.Xr isgraph 3 . ) +except space, tab, and newline are encoded (see +.Xr isgraph 3 ) . The following flags alter this: .Bl -tag -width VIS_WHITEX .It Dv VIS_GLOB -Also encode magic characters +Also encode the magic characters .Ql ( * , .Ql \&? , .Ql \&[ @@ -243,11 +259,13 @@ Synonym for \&| .Dv VIS_NL . .It Dv VIS_SAFE -Only encode "unsafe" characters. +Only encode +.Dq unsafe +characters. Unsafe means control characters which may cause common terminals to perform unexpected functions. Currently this form allows space, tab, newline, backspace, bell, and -return - in addition to all graphic characters - unencoded. +return \(em in addition to all graphic characters \(em unencoded. .El .Pp (The above flags have no effect for @@ -287,8 +305,8 @@ Use an to represent meta characters (characters with the 8th bit set), and use caret .Ql ^ -to represent control characters see -.Pf ( Xr iscntrl 3 ) . +to represent control characters (see +.Xr iscntrl 3 ) . The following formats are used: .Bl -tag -width xxxxx .It Dv \e^C @@ -335,19 +353,20 @@ Use C-style backslash sequences to repre characters. The following sequences are used to represent the indicated characters: .Bd -unfilled -offset indent -.Li \ea Tn - BEL No (007) -.Li \eb Tn - BS No (010) -.Li \ef Tn - NP No (014) -.Li \en Tn - NL No (012) -.Li \er Tn - CR No (015) -.Li \es Tn - SP No (040) -.Li \et Tn - HT No (011) -.Li \ev Tn - VT No (013) -.Li \e0 Tn - NUL No (000) +.Li \ea Tn \(em BEL No (007) +.Li \eb Tn \(em BS No (010) +.Li \ef Tn \(em NP No (014) +.Li \en Tn \(em NL No (012) +.Li \er Tn \(em CR No (015) +.Li \es Tn \(em SP No (040) +.Li \et Tn \(em HT No (011) +.Li \ev Tn \(em VT No (013) +.Li \e0 Tn \(em NUL No (000) .Ed .Pp -When using this format, the nextc parameter is looked at to determine -if a +When using this format, the +.Fa nextc +parameter is looked at to determine if a .Dv NUL character can be encoded as .Ql \e0 @@ -374,8 +393,8 @@ represents a lower case hexadecimal digi .It Dv VIS_MIMESTYLE Use MIME Quoted-Printable encoding as described in RFC 2045, only don't break lines and don't handle CRLF. -The form is: -.Ql %XX +The form is +.Ql =XX where .Em X represents an upper case hexadecimal digit. @@ -392,6 +411,41 @@ meta characters as .Ql M-C ) . With this flag set, the encoding is ambiguous and non-invertible. +.Sh MULTIBYTE CHARACTER SUPPORT +These functions support multibyte character input. +The encoding conversion is influenced by the setting of the +.Ev LC_CTYPE +environment variable which defines the set of characters +that can be copied without encoding. +.Pp +When 8-bit data is present in the input, +.Ev LC_CTYPE +must be set to the correct locale or to the C locale. +If the locales of the data and the conversion are mismatched, +multibyte character recognition may fail and encoding will be performed +byte-by-byte instead. +.Pp +As noted above, +.Fa dst +must be four times the number of bytes processed from +.Fa src . +But note that each multibyte character can be up to +.Dv MB_LEN_MAX +bytes +.\" (see +.\" .Xr multibyte 3 ) +so in terms of multibyte characters, +.Fa dst +must be four times +.Dv MB_LEN_MAX +times the number of characters processed from +.Fa src . +.Sh ENVIRONMENT +.Bl -tag -width ".Ev LC_CTYPE" +.It Ev LC_CTYPE +Specify the locale of the input data. +Set to C if the input data locale is unknown. +.El .Sh ERRORS The functions .Fn nvis @@ -407,11 +461,11 @@ and .Fn strsnvisx , will return \-1 when the .Fa dlen -destination buffer length size is not enough to perform the conversion while +destination buffer size is not enough to perform the conversion while setting .Va errno to: -.Bl -tag -width Er +.Bl -tag -width ".Bq Er ENOSPC" .It Bq Er ENOSPC The destination buffer size is not large enough to perform the conversion. .El @@ -419,18 +473,23 @@ The destination buffer size is not large .Xr unvis 1 , .Xr vis 1 , .Xr glob 3 , +.\" .Xr multibyte 3 , .Xr unvis 3 .Rs .%A T. Berners-Lee .%T Uniform Resource Locators (URL) -.%O RFC1738 +.%O "RFC 1738" +.Re +.Rs +.%T "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies" +.%O "RFC 2045" .Re .Sh HISTORY The .Fn vis , .Fn strvis , and -.Fa strvisx +.Fn strvisx functions first appeared in .Bx 4.4 . The @@ -441,7 +500,7 @@ and functions appeared in .Nx 1.5 and -.Fx 10.0 . +.Fx 9.2 . The buffer size limited versions of the functions .Po Fn nvis , .Fn strnvis , @@ -451,6 +510,9 @@ The buffer size limited versions of the and .Fn strsnvisx Pc appeared in -.Nx 6.0 and -.Fx 10.0 . +.Fx 9.2 . +Myltibyte character support was added in +.Nx 7.0 +and +.Fx 9.2 . Modified: stable/9/contrib/libc-vis/vis.c ============================================================================== --- stable/9/contrib/libc-vis/vis.c Tue Apr 16 19:25:41 2013 (r249559) +++ stable/9/contrib/libc-vis/vis.c Tue Apr 16 19:27:09 2013 (r249560) @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $ */ +/* $NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,19 +57,23 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.45 2012/12/14 21:38:18 christos Exp $"); +__RCSID("$NetBSD: vis.c,v 1.60 2013/02/21 16:21:20 joerg Exp $"); #endif /* LIBC_SCCS and not lint */ +#ifdef __FBSDID __FBSDID("$FreeBSD$"); +#define _DIAGASSERT(x) assert(x) +#endif #include "namespace.h" #include +#include #include #include #include #include - -#define _DIAGASSERT(x) assert(x) +#include +#include #ifdef __weak_alias __weak_alias(strvisx,_strvisx) @@ -81,65 +85,66 @@ __weak_alias(strvisx,_strvisx) #include #include -static char *do_svis(char *, size_t *, int, int, int, const char *); +/* + * The reason for going through the trouble to deal with character encodings + * in vis(3), is that we use this to safe encode output of commands. This + * safe encoding varies depending on the character set. For example if we + * display ps output in French, we don't want to display French characters + * as M-foo. + */ + +static wchar_t *do_svis(wchar_t *, wint_t, int, wint_t, const wchar_t *); #undef BELL -#define BELL '\a' +#define BELL L'\a' + +#define iswoctal(c) (((u_char)(c)) >= L'0' && ((u_char)(c)) <= L'7') +#define iswwhite(c) (c == L' ' || c == L'\t' || c == L'\n') +#define iswsafe(c) (c == L'\b' || c == BELL || c == L'\r') +#define xtoa(c) L"0123456789abcdef"[c] +#define XTOA(c) L"0123456789ABCDEF"[c] -#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') -#define iswhite(c) (c == ' ' || c == '\t' || c == '\n') -#define issafe(c) (c == '\b' || c == BELL || c == '\r') -#define xtoa(c) "0123456789abcdef"[c] -#define XTOA(c) "0123456789ABCDEF"[c] - -#define MAXEXTRAS 9 - -#define MAKEEXTRALIST(flag, extra, orig_str) \ -do { \ - const char *orig = orig_str; \ - const char *o = orig; \ - char *e; \ - while (*o++) \ - continue; \ - extra = malloc((size_t)((o - orig) + MAXEXTRAS)); \ - if (!extra) break; \ - for (o = orig, e = extra; (*e++ = *o++) != '\0';) \ - continue; \ - e--; \ - if (flag & VIS_GLOB) { \ - *e++ = '*'; \ - *e++ = '?'; \ - *e++ = '['; \ - *e++ = '#'; \ - } \ - if (flag & VIS_SP) *e++ = ' '; \ - if (flag & VIS_TAB) *e++ = '\t'; \ - if (flag & VIS_NL) *e++ = '\n'; \ - if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \ - *e = '\0'; \ -} while (/*CONSTCOND*/0) +#define MAXEXTRAS 10 + +#if !HAVE_NBTOOL_CONFIG_H +#ifndef __NetBSD__ +/* + * On NetBSD MB_LEN_MAX is currently 32 which does not fit on any integer + * integral type and it is probably wrong, since currently the maximum + * number of bytes and character needs is 6. Until this is fixed, the + * loops below are using sizeof(uint64_t) - 1 instead of MB_LEN_MAX, and + * the assertion is commented out. + */ +#ifdef __FreeBSD__ +/* + * On FreeBSD including for CTASSERT only works in kernel + * mode. + */ +#ifndef CTASSERT +#define CTASSERT(x) _CTASSERT(x, __LINE__) +#define _CTASSERT(x, y) __CTASSERT(x, y) +#define __CTASSERT(x, y) typedef char __assert ## y[(x) ? 1 : -1] +#endif +#endif /* __FreeBSD__ */ +CTASSERT(MB_LEN_MAX <= sizeof(uint64_t)); +#endif /* !__NetBSD__ */ +#endif /* * This is do_hvis, for HTTP style (RFC 1808) */ -static char * -do_hvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +do_hvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) { - - if ((isascii(c) && isalnum(c)) + if (iswalnum(c) /* safe */ - || c == '$' || c == '-' || c == '_' || c == '.' || c == '+' + || c == L'$' || c == L'-' || c == L'_' || c == L'.' || c == L'+' /* extra */ - || c == '!' || c == '*' || c == '\'' || c == '(' || c == ')' - || c == ',') { - dst = do_svis(dst, dlen, c, flag, nextc, extra); - } else { - if (dlen) { - if (*dlen < 3) - return NULL; - *dlen -= 3; - } - *dst++ = '%'; + || c == L'!' || c == L'*' || c == L'\'' || c == L'(' || c == L')' + || c == L',') + dst = do_svis(dst, c, flags, nextc, extra); + else { + *dst++ = L'%'; *dst++ = xtoa(((unsigned int)c >> 4) & 0xf); *dst++ = xtoa((unsigned int)c & 0xf); } @@ -151,312 +156,448 @@ do_hvis(char *dst, size_t *dlen, int c, * This is do_mvis, for Quoted-Printable MIME (RFC 2045) * NB: No handling of long lines or CRLF. */ -static char * -do_mvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +do_mvis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) { - if ((c != '\n') && + if ((c != L'\n') && /* Space at the end of the line */ - ((isspace(c) && (nextc == '\r' || nextc == '\n')) || + ((iswspace(c) && (nextc == L'\r' || nextc == L'\n')) || /* Out of range */ - (!isspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) || - /* Specific char to be escaped */ - strchr("#$@[\\]^`{|}~", c) != NULL)) { - if (dlen) { - if (*dlen < 3) - return NULL; - *dlen -= 3; - } - *dst++ = '='; + (!iswspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) || + /* Specific char to be escaped */ + wcschr(L"#$@[\\]^`{|}~", c) != NULL)) { + *dst++ = L'='; *dst++ = XTOA(((unsigned int)c >> 4) & 0xf); *dst++ = XTOA((unsigned int)c & 0xf); - } else { - dst = do_svis(dst, dlen, c, flag, nextc, extra); - } + } else + dst = do_svis(dst, c, flags, nextc, extra); return dst; } /* - * This is do_vis, the central code of vis. - * dst: Pointer to the destination buffer - * c: Character to encode - * flag: Flag word - * nextc: The character following 'c' - * extra: Pointer to the list of extra characters to be - * backslash-protected. + * Output single byte of multibyte character. */ -static char * -do_svis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +do_mbyte(wchar_t *dst, wint_t c, int flags, wint_t nextc, int iswextra) { - int isextra; - size_t odlen = dlen ? *dlen : 0; - - isextra = strchr(extra, c) != NULL; -#define HAVE(x) \ - do { \ - if (dlen) { \ - if (*dlen < (x)) \ - goto out; \ - *dlen -= (x); \ - } \ - } while (/*CONSTCOND*/0) - if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) || - ((flag & VIS_SAFE) && issafe(c)))) { - HAVE(1); - *dst++ = c; - return dst; - } - if (flag & VIS_CSTYLE) { - HAVE(2); + if (flags & VIS_CSTYLE) { switch (c) { - case '\n': - *dst++ = '\\'; *dst++ = 'n'; + case L'\n': + *dst++ = L'\\'; *dst++ = L'n'; return dst; - case '\r': - *dst++ = '\\'; *dst++ = 'r'; + case L'\r': + *dst++ = L'\\'; *dst++ = L'r'; return dst; - case '\b': - *dst++ = '\\'; *dst++ = 'b'; + case L'\b': + *dst++ = L'\\'; *dst++ = L'b'; return dst; case BELL: - *dst++ = '\\'; *dst++ = 'a'; + *dst++ = L'\\'; *dst++ = L'a'; return dst; - case '\v': - *dst++ = '\\'; *dst++ = 'v'; + case L'\v': + *dst++ = L'\\'; *dst++ = L'v'; return dst; - case '\t': - *dst++ = '\\'; *dst++ = 't'; + case L'\t': + *dst++ = L'\\'; *dst++ = L't'; return dst; - case '\f': - *dst++ = '\\'; *dst++ = 'f'; + case L'\f': + *dst++ = L'\\'; *dst++ = L'f'; return dst; - case ' ': - *dst++ = '\\'; *dst++ = 's'; + case L' ': + *dst++ = L'\\'; *dst++ = L's'; return dst; - case '\0': - *dst++ = '\\'; *dst++ = '0'; - if (isoctal(nextc)) { - HAVE(2); - *dst++ = '0'; - *dst++ = '0'; + case L'\0': + *dst++ = L'\\'; *dst++ = L'0'; + if (iswoctal(nextc)) { + *dst++ = L'0'; + *dst++ = L'0'; } return dst; default: - if (isgraph(c)) { - *dst++ = '\\'; *dst++ = c; + if (iswgraph(c)) { + *dst++ = L'\\'; + *dst++ = c; return dst; } - if (dlen) - *dlen = odlen; } } - if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { - HAVE(4); - *dst++ = '\\'; - *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0'; - *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0'; - *dst++ = (c & 07) + '0'; + if (iswextra || ((c & 0177) == L' ') || (flags & VIS_OCTAL)) { + *dst++ = L'\\'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + L'0'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + L'0'; + *dst++ = (c & 07) + L'0'; } else { - if ((flag & VIS_NOSLASH) == 0) { - HAVE(1); - *dst++ = '\\'; - } + if ((flags & VIS_NOSLASH) == 0) + *dst++ = L'\\'; if (c & 0200) { - HAVE(1); - c &= 0177; *dst++ = 'M'; + c &= 0177; + *dst++ = L'M'; } - if (iscntrl(c)) { - HAVE(2); - *dst++ = '^'; + if (iswcntrl(c)) { + *dst++ = L'^'; if (c == 0177) - *dst++ = '?'; + *dst++ = L'?'; else - *dst++ = c + '@'; + *dst++ = c + L'@'; } else { - HAVE(2); - *dst++ = '-'; *dst++ = c; + *dst++ = L'-'; + *dst++ = c; } } + + return dst; +} + +/* + * This is do_vis, the central code of vis. + * dst: Pointer to the destination buffer + * c: Character to encode + * flags: Flags word + * nextc: The character following 'c' + * extra: Pointer to the list of extra characters to be + * backslash-protected. + */ +static wchar_t * +do_svis(wchar_t *dst, wint_t c, int flags, wint_t nextc, const wchar_t *extra) +{ + int iswextra, i, shft; + uint64_t bmsk, wmsk; + + iswextra = wcschr(extra, c) != NULL; + if (!iswextra && (iswgraph(c) || iswwhite(c) || + ((flags & VIS_SAFE) && iswsafe(c)))) { + *dst++ = c; + return dst; + } + + /* See comment in istrsenvisx() output loop, below. */ + wmsk = 0; + for (i = sizeof(wmsk) - 1; i >= 0; i--) { + shft = i * NBBY; + bmsk = (uint64_t)0xffLL << shft; + wmsk |= bmsk; + if ((c & wmsk) || i == 0) + dst = do_mbyte(dst, (wint_t)( + (uint64_t)(c & bmsk) >> shft), + flags, nextc, iswextra); + } + return dst; -out: - *dlen = odlen; - return NULL; } -typedef char *(*visfun_t)(char *, size_t *, int, int, int, const char *); +typedef wchar_t *(*visfun_t)(wchar_t *, wint_t, int, wint_t, const wchar_t *); /* * Return the appropriate encoding function depending on the flags given. */ static visfun_t -getvisfun(int flag) +getvisfun(int flags) { - if (flag & VIS_HTTPSTYLE) + if (flags & VIS_HTTPSTYLE) return do_hvis; - if (flag & VIS_MIMESTYLE) + if (flags & VIS_MIMESTYLE) return do_mvis; return do_svis; } /* - * isnvis - visually encode characters, also encoding the characters - * pointed to by `extra' + * Expand list of extra characters to not visually encode. */ -static char * -isnvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +static wchar_t * +makeextralist(int flags, const char *src) { - char *nextra = NULL; - visfun_t f; + wchar_t *dst, *d; + size_t len; - _DIAGASSERT(dst != NULL); - _DIAGASSERT(extra != NULL); - MAKEEXTRALIST(flag, nextra, extra); - if (!nextra) { - if (dlen && *dlen == 0) { - errno = ENOSPC; - return NULL; - } - *dst = '\0'; /* can't create nextra, return "" */ - return dst; - } - f = getvisfun(flag); - dst = (*f)(dst, dlen, c, flag, nextc, nextra); - free(nextra); - if (dst == NULL || (dlen && *dlen == 0)) { - errno = ENOSPC; + len = strlen(src); + if ((dst = calloc(len + MAXEXTRAS, sizeof(*dst))) == NULL) return NULL; - } - *dst = '\0'; - return dst; -} -char * -svis(char *dst, int c, int flag, int nextc, const char *extra) -{ - return isnvis(dst, NULL, c, flag, nextc, extra); -} + if (mbstowcs(dst, src, len) == (size_t)-1) { + size_t i; + for (i = 0; i < len; i++) + dst[i] = (wint_t)(u_char)src[i]; + d = dst + len; + } else + d = dst + wcslen(dst); + + if (flags & VIS_GLOB) { + *d++ = L'*'; + *d++ = L'?'; + *d++ = L'['; + *d++ = L'#'; + } + + if (flags & VIS_SP) *d++ = L' '; + if (flags & VIS_TAB) *d++ = L'\t'; + if (flags & VIS_NL) *d++ = L'\n'; + if ((flags & VIS_NOSLASH) == 0) *d++ = L'\\'; + *d = L'\0'; -char * -snvis(char *dst, size_t dlen, int c, int flag, int nextc, const char *extra) -{ - return isnvis(dst, &dlen, c, flag, nextc, extra); + return dst; } - /* - * strsvis, strsvisx - visually encode characters from src into dst - * - * Extra is a pointer to a \0-terminated list of characters to - * be encoded, too. These functions are useful e. g. to - * encode strings in such a way so that they are not interpreted - * by a shell. - * - * Dst must be 4 times the size of src to account for possible - * expansion. The length of dst, not including the trailing NULL, - * is returned. - * - * Strsvisx encodes exactly len bytes from src into dst. - * This is useful for encoding a block of data. + * istrsenvisx() + * The main internal function. + * All user-visible functions call this one. */ static int -istrsnvis(char *dst, size_t *dlen, const char *csrc, int flag, const char *extra) +istrsenvisx(char *mbdst, size_t *dlen, const char *mbsrc, size_t mblength, + int flags, const char *mbextra, int *cerr_ptr) { - int c; - char *start; - char *nextra = NULL; - const unsigned char *src = (const unsigned char *)csrc; + wchar_t *dst, *src, *pdst, *psrc, *start, *extra; + size_t len, olen; + uint64_t bmsk, wmsk; + wint_t c; visfun_t f; + int clen = 0, cerr = 0, error = -1, i, shft; + ssize_t mbslength, maxolen; - _DIAGASSERT(dst != NULL); - _DIAGASSERT(src != NULL); - _DIAGASSERT(extra != NULL); - MAKEEXTRALIST(flag, nextra, extra); - if (!nextra) { - *dst = '\0'; /* can't create nextra, return "" */ - return 0; + _DIAGASSERT(mbdst != NULL); + _DIAGASSERT(mbsrc != NULL); + _DIAGASSERT(mbextra != NULL); + + /* + * Input (mbsrc) is a char string considered to be multibyte + * characters. The input loop will read this string pulling + * one character, possibly multiple bytes, from mbsrc and + * converting each to wchar_t in src. + * + * The vis conversion will be done using the wide char + * wchar_t string. + * + * This will then be converted back to a multibyte string to + * return to the caller. + */ + + /* Allocate space for the wide char strings */ + psrc = pdst = extra = NULL; + if (!mblength) + mblength = strlen(mbsrc); + if ((psrc = calloc(mblength + 1, sizeof(*psrc))) == NULL) + return -1; + if ((pdst = calloc((4 * mblength) + 1, sizeof(*pdst))) == NULL) + goto out; + dst = pdst; + src = psrc; + + /* Use caller's multibyte conversion error flag. */ + if (cerr_ptr) + cerr = *cerr_ptr; + + /* + * Input loop. + * Handle up to mblength characters (not bytes). We do not + * stop at NULs because we may be processing a block of data + * that includes NULs. + */ + mbslength = (ssize_t)mblength; + /* + * When inputing a single character, must also read in the + * next character for nextc, the look-ahead character. + */ + if (mbslength == 1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Tue Apr 16 19:28:01 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 62805B3E; Tue, 16 Apr 2013 19:28:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54C2C11CC; Tue, 16 Apr 2013 19:28:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3GJS1Xm075190; Tue, 16 Apr 2013 19:28:01 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3GJS1db075181; Tue, 16 Apr 2013 19:28:01 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201304161928.r3GJS1db075181@svn.freebsd.org> From: Brooks Davis Date: Tue, 16 Apr 2013 19:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249561 - in stable/9/usr.bin: unvis vis X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 19:28:01 -0000 Author: brooks Date: Tue Apr 16 19:28:00 2013 New Revision: 249561 URL: http://svnweb.freebsd.org/changeset/base/249561 Log: MFC r248303: Replace our (un)vis(1) commands with implementations from NetBSD to match our import of the (un)vis(3) APIs. This adds support for multibyte encoding and the -h and -m flags which support HTTP and MIME encoding respectively. PR: bin/175418 Obtained from: NetBSD Added: - copied from r249557, head/contrib/unvis/ - copied from r249557, head/contrib/vis/ Directory Properties: stable/9/contrib/unvis/ (props changed) stable/9/contrib/vis/ (props changed) Deleted: stable/9/usr.bin/unvis/unvis.1 stable/9/usr.bin/unvis/unvis.c stable/9/usr.bin/vis/extern.h stable/9/usr.bin/vis/foldit.c stable/9/usr.bin/vis/vis.1 stable/9/usr.bin/vis/vis.c Modified: stable/9/usr.bin/unvis/Makefile stable/9/usr.bin/vis/Makefile Directory Properties: stable/9/usr.bin/unvis/ (props changed) stable/9/usr.bin/vis/ (props changed) Modified: stable/9/usr.bin/unvis/Makefile ============================================================================== --- stable/9/usr.bin/unvis/Makefile Tue Apr 16 19:27:09 2013 (r249560) +++ stable/9/usr.bin/unvis/Makefile Tue Apr 16 19:28:00 2013 (r249561) @@ -3,4 +3,6 @@ PROG= unvis +.PATH: ${.CURDIR}/../../contrib/unvis + .include Modified: stable/9/usr.bin/vis/Makefile ============================================================================== --- stable/9/usr.bin/vis/Makefile Tue Apr 16 19:27:09 2013 (r249560) +++ stable/9/usr.bin/vis/Makefile Tue Apr 16 19:28:00 2013 (r249561) @@ -1,6 +1,10 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 +# $FreeBSD$ PROG= vis SRCS= vis.c foldit.c +.PATH: ${.CURDIR}/../../contrib/vis +CFLAGS+= -I${.CURDIR}/../../contrib/vis + .include From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 08:32:06 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4BF0B33C for ; Wed, 17 Apr 2013 08:32:06 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta11.emeryville.ca.mail.comcast.net (qmta11.emeryville.ca.mail.comcast.net [76.96.27.211]) by mx1.freebsd.org (Postfix) with ESMTP id 30F9137A for ; Wed, 17 Apr 2013 08:32:05 +0000 (UTC) Received: from omta23.emeryville.ca.mail.comcast.net ([76.96.30.90]) by qmta11.emeryville.ca.mail.comcast.net with comcast id QwVx1l0031wfjNsABwVxAC; Wed, 17 Apr 2013 08:29:57 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta23.emeryville.ca.mail.comcast.net with comcast id QwVw1l0071t3BNj8jwVw3N; Wed, 17 Apr 2013 08:29:56 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 2512373A33; Wed, 17 Apr 2013 01:29:56 -0700 (PDT) Date: Wed, 17 Apr 2013 01:29:56 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417082956.GA98554@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201304161609.r3GG9SID009937@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366187397; bh=hZgqcuTfeJMjWplpegBrFkod3tgvCGkx4BH1X+O8HtY=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=tCVbuoGs4XVOO0pn8gfkhbO9GMQuc7MJMOWr9CSvjHR46KUuAKKn9NtAUOfMQ0FJ+ nKqyMmE3ymFHmNpwi5PS6eMLnNSaWawvdxax4heHlTg/t2Iy7wJksUgCV3qq6IIZRw 48aLkFm3PEFwnfV9vqSCWQlrIi2m9RHmwAJC9wYFQarhQzIlKGDaZZiog9A8uE3ZSE v35DchLycp2QNgPfkAPtPphGfLRphGKlft5XQoJHCt8H85kpsufnkru+ZQVkFXA7QR lVm/+gN5pZxJ60A9cS94rd6p7l17+/MRRA849Wwo7lq5Ydf+ULxfjkGwkfrZOTjjz+ 9RyId2jr53DhA== Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 08:32:06 -0000 On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: > Author: brooks > Date: Tue Apr 16 16:09:27 2013 > New Revision: 249549 > URL: http://svnweb.freebsd.org/changeset/base/249549 > > Log: > MFC (much delayed) 234504: > > Enable DTrace hooks in GENERIC. > > Modified: > stable/9/sys/amd64/conf/GENERIC > stable/9/sys/i386/conf/GENERIC > Directory Properties: > stable/9/sys/ (props changed) > > Modified: stable/9/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/9/sys/amd64/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/amd64/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -22,6 +22,7 @@ cpu HAMMER > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -63,11 +64,12 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_FRAME # Ensure frames are compiled in > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_FRAME # Ensure frames are compiled in > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # Make an SMP-capable kernel by default > options SMP # Symmetric MultiProcessor Kernel > > Modified: stable/9/sys/i386/conf/GENERIC > ============================================================================== > --- stable/9/sys/i386/conf/GENERIC Tue Apr 16 14:22:16 2013 (r249548) > +++ stable/9/sys/i386/conf/GENERIC Tue Apr 16 16:09:27 2013 (r249549) > @@ -24,6 +24,7 @@ cpu I686_CPU > ident GENERIC > > makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols > +makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support > > options SCHED_ULE # ULE scheduler > options PREEMPTION # Enable kernel thread preemption > @@ -64,10 +65,11 @@ options KBD_INSTALL_CDEV # install a CD > options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4) > options AUDIT # Security event auditing > options MAC # TrustedBSD MAC Framework > -#options KDTRACE_HOOKS # Kernel DTrace hooks > +options KDTRACE_HOOKS # Kernel DTrace hooks > options INCLUDE_CONFIG_FILE # Include this file in kernel > options KDB # Kernel debugger related code > options KDB_TRACE # Print a stack trace for a panic > +options DDB_CTF # kernel ELF linker loads CTF data > > # To make an SMP kernel, the next two lines are needed > options SMP # Symmetric MultiProcessor Kernel And here come the complaints, which warrant responses from key folks who are in the know: http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 13:01:32 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6D5C3A4; Wed, 17 Apr 2013 13:01:32 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE157D3; Wed, 17 Apr 2013 13:01:32 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id 79603C3FB4; Wed, 17 Apr 2013 12:54:33 +0000 (UTC) Date: Wed, 17 Apr 2013 14:54:33 +0200 From: Jeremie Le Hen To: Jeremy Chadwick Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417125433.GC30222@caravan.chchile.org> Mail-Followup-To: Jeremy Chadwick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130416161919.GA80626@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 13:01:32 -0000 Hi Jeremy, On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > Now that this has been enabled by default, I should warn folks of a > caveat that I found in the buildworld/buildkernel framework. It's > easiest to explain like this: > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > 2. Add WITHOUT_CDDL=true to /etc/src.conf > 3. Rebuild + install kernel/world per src/Makefile procedure > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > 5. rm -fr /usr/obj/* > 6. Rebuild world > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > For whatever reason the buildkernel bits make the assumption that > ctfconvert exists on the system (presumably in $PATH or possibly a > hard-coded), when ideally it should try to use the recently-built > version in /usr/obj first. I've tested this is a freshly installed 9.1-RELEASE jail and I haven't been biten by the bug you describe. ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is probably there problem didn't occur. I can easily verify this in the jail: % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi Do you have a theory about why you've got the problem while I haven't? FYI, it seems 9.0-RELEASE also has ctfconvert(1): http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ My guess is tha this might happen if you don't have /usr/bin/ctfconvert. I've just removed it and trying to build kernel again. Regards, -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 15:47:31 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A2493C0 for ; Wed, 17 Apr 2013 15:47:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm30-vm0.bullet.mail.bf1.yahoo.com (nm30-vm0.bullet.mail.bf1.yahoo.com [98.139.213.126]) by mx1.freebsd.org (Postfix) with ESMTP id A7DC213D for ; Wed, 17 Apr 2013 15:47:30 +0000 (UTC) Received: from [98.139.212.145] by nm30.bullet.mail.bf1.yahoo.com with NNFMP; 17 Apr 2013 15:41:23 -0000 Received: from [98.139.213.1] by tm2.bullet.mail.bf1.yahoo.com with NNFMP; 17 Apr 2013 15:41:23 -0000 Received: from [127.0.0.1] by smtp101.mail.bf1.yahoo.com with NNFMP; 17 Apr 2013 15:41:23 -0000 X-Yahoo-Newman-Id: 305566.95581.bm@smtp101.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: rik1hBwVM1ngBm7eCZT6OxVypD4nTE1qbHz.owyg95QV_JI uIHYQh112FHpBHr8G7MpoioHXqZErvLABnOFbawrys.AZq50KV3QssyxQJik uH5yFoHjaVa_S1Vshkj_V.3FVlMKx_FLU.caczwhZpzsclLd_iK_RteKWzyX TPXQakDjJxGGIZ85qPISKiD2aLh9PhYOl67ycjfwaUadLh_PbXKj9qYno.sj Sh9lppl8QnDd1sxggJDosWkiWAqCqTdlh7x6CL2gyprs._2PlCG7s1kUJqgq BjoHAApD4jrdc5sO5TRnZj8rZ6tQPOvw9ADBqsIVKUI_UM63JoVpNg6YeFKD 9uZQa1KvKpcT4HARmo.6j0DnfLuImusCrahHqxWDZI.fMAtjA1qPAxJRxbUD 3GMlbse0WDtjXjJ7.IB1wGS5IcR.LgQ5phIk64t7B5cXDSBkkOLo2E9zsbPt RpS6PqUPC1m4kM8A8Wu20r3VvNuOCMItwJm5854X746ZInVBay7.gXcyP4V. O4I2Eibf9e9FzdILrHoID68LnepccpbJfFTaTWVxeGjEPLA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.102] (pfg@190.157.126.109 with ) by smtp101.mail.bf1.yahoo.com with SMTP; 17 Apr 2013 15:41:23 +0000 UTC Message-ID: <516EC2A0.6090102@FreeBSD.org> Date: Wed, 17 Apr 2013 10:41:20 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130324 Thunderbird/17.0.4 MIME-Version: 1.0 To: Jeremy Chadwick Subject: Re: make buildkernel for GENERIC 9-STABLE just hangs, no error (was svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf) References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130417082956.GA98554@icarus.home.lan> In-Reply-To: <20130417082956.GA98554@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: =?ISO-8859-1?Q?Olav_Gr=F8n=E5s_Gjerde?= , svn-src-all@freebsd.org, freebsd-stable@freebsd.org, svn-src-stable-9@freebsd.org, svn-src-stable@freebsd.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 15:47:31 -0000 On 04/17/13 03:29, Jeremy Chadwick wrote: > On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: >> Author: brooks >> Date: Tue Apr 16 16:09:27 2013 >> New Revision: 249549 >> URL: http://svnweb.freebsd.org/changeset/base/249549 >> >> Log: >> MFC (much delayed) 234504: >> >> Enable DTrace hooks in GENERIC. >> >> Modified: >> stable/9/sys/amd64/conf/GENERIC >> stable/9/sys/i386/conf/GENERIC >> Directory Properties: >> stable/9/sys/ (props changed) >> >> ... > And here come the complaints, which warrant responses from key folks who > are in the know: > > http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html > It looks like 9 days ago there was a change (r249243) that fixed issues on the userland ctf utilities, so you have to update your userland too if it's not recent (make buildworld works fine). Hope that helps, Pedro. From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 17:42:58 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5FECBAA5; Wed, 17 Apr 2013 17:42:58 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 2336C8D0; Wed, 17 Apr 2013 17:42:58 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::dc79:2881:589:7d77] (unknown [IPv6:2001:7b8:3a7:0:dc79:2881:589:7d77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6743D5C45; Wed, 17 Apr 2013 19:42:57 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: make buildkernel for GENERIC 9-STABLE just hangs, no error (was svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf) From: Dimitry Andric In-Reply-To: <516EC2A0.6090102@FreeBSD.org> Date: Wed, 17 Apr 2013 19:42:43 +0200 Content-Transfer-Encoding: 7bit Message-Id: <13CE3D12-75A7-46A9-920A-F12753E8CF7A@andric.com> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130417082956.GA98554@icarus.home.lan> <516EC2A0.6090102@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.1503) Cc: freebsd-stable@freebsd.org, svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, =?iso-8859-1?Q?Olav_Gr=F8n=E5s_Gjerde?= X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 17:42:58 -0000 On Apr 17, 2013, at 17:41, Pedro Giffuni wrote: > On 04/17/13 03:29, Jeremy Chadwick wrote: >> On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: >>> Author: brooks >>> Date: Tue Apr 16 16:09:27 2013 >>> New Revision: 249549 >>> URL: http://svnweb.freebsd.org/changeset/base/249549 >>> >>> Log: >>> MFC (much delayed) 234504: >>> Enable DTrace hooks in GENERIC. >>> >>> Modified: >>> stable/9/sys/amd64/conf/GENERIC >>> stable/9/sys/i386/conf/GENERIC >>> Directory Properties: >>> stable/9/sys/ (props changed) >>> >>> ... >> And here come the complaints, which warrant responses from key folks who >> are in the know: >> >> http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html >> > > It looks like 9 days ago there was a change (r249243) that fixed > issues on the userland ctf utilities, so you have to update your > userland too if it's not recent (make buildworld works fine). That was only a fix for certain DWARF attributes emitted by clang and/or newer gcc's, which would cause ctfmerge to error out. If ctfmerge is hanging, that is almost certainly another problem. That is, if it is really hanging, isn't it just very slow, maybe? What happens if the original poster lets it run for e.g. an hour? From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 18:02:32 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB4ED156; Wed, 17 Apr 2013 18:02:32 +0000 (UTC) (envelope-from olavgg@gmail.com) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com [209.85.217.175]) by mx1.freebsd.org (Postfix) with ESMTP id A6BD19CB; Wed, 17 Apr 2013 18:02:31 +0000 (UTC) Received: by mail-lb0-f175.google.com with SMTP id o10so1887240lbi.20 for ; Wed, 17 Apr 2013 11:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=zhD3PfcKZ0mzzjc0BBw078I4sJzw58AplrCbs2Ag6Rw=; b=K4kcmPxC1EiNNGidFVq2ObBsZiMmHRKTTmCPtOrOvc2s86Z61aK28REdze3apRXNRq bfAAvTFntbPZ+NhOigjn/SN5f7eU0T+aO8fGiM1yY6Xu6azRRfckt3jhwo3+548DVmuB H6kfB1Whzxj6fllHgj9ojI6ttwfiNRppHf+p8MMdMQIo50szSuOUXvs8SocHf2ADhNb3 C1pFFrCr8HMXlQqhw5PNNWJVpWTjq3Jy/UwKkGYzGGISe6XSjZKjgbxAkk4ftx4rPUPp J+0EKrlCUYA9/MJ2IWrZXP6GD/G4R6C0eYW/QyzFAvbPKwViCErNdRpubnbCang6nAOk n0TA== MIME-Version: 1.0 X-Received: by 10.152.120.40 with SMTP id kz8mr4049092lab.32.1366221744595; Wed, 17 Apr 2013 11:02:24 -0700 (PDT) Received: by 10.112.23.232 with HTTP; Wed, 17 Apr 2013 11:02:24 -0700 (PDT) In-Reply-To: <13CE3D12-75A7-46A9-920A-F12753E8CF7A@andric.com> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130417082956.GA98554@icarus.home.lan> <516EC2A0.6090102@FreeBSD.org> <13CE3D12-75A7-46A9-920A-F12753E8CF7A@andric.com> Date: Wed, 17 Apr 2013 20:02:24 +0200 Message-ID: Subject: Re: make buildkernel for GENERIC 9-STABLE just hangs, no error (was svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf) From: =?ISO-8859-1?Q?Olav_Gr=F8n=E5s_Gjerde?= To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Stable Mailing List , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Pedro Giffuni X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 18:02:32 -0000 I have to admit that I didn't wait for an hour, as buildkernel usually complete within 30 minutes on my system. I just tried to build the kernel on another very similar system, no problems there. I forgot to mention that I tried to upgrade from an 8-STABLE from last summer directly to the latest 9-STABLE. Most likely its just something very wrong with my setup and a complete reinstallation would probably be a good idea. Thanks for your help. On Wed, Apr 17, 2013 at 7:42 PM, Dimitry Andric wrote: > On Apr 17, 2013, at 17:41, Pedro Giffuni wrote: > > On 04/17/13 03:29, Jeremy Chadwick wrote: > >> On Tue, Apr 16, 2013 at 04:09:28PM +0000, Brooks Davis wrote: > >>> Author: brooks > >>> Date: Tue Apr 16 16:09:27 2013 > >>> New Revision: 249549 > >>> URL: http://svnweb.freebsd.org/changeset/base/249549 > >>> > >>> Log: > >>> MFC (much delayed) 234504: > >>> Enable DTrace hooks in GENERIC. > >>> > >>> Modified: > >>> stable/9/sys/amd64/conf/GENERIC > >>> stable/9/sys/i386/conf/GENERIC > >>> Directory Properties: > >>> stable/9/sys/ (props changed) > >>> > >>> ... > >> And here come the complaints, which warrant responses from key folks who > >> are in the know: > >> > >> > http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073132.html > >> > > > > It looks like 9 days ago there was a change (r249243) that fixed > > issues on the userland ctf utilities, so you have to update your > > userland too if it's not recent (make buildworld works fine). > > That was only a fix for certain DWARF attributes emitted by clang and/or > newer gcc's, which would cause ctfmerge to error out. > > If ctfmerge is hanging, that is almost certainly another problem. That > is, if it is really hanging, isn't it just very slow, maybe? What > happens if the original poster lets it run for e.g. an hour? > > From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 19:35:39 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BF0A3B1B for ; Wed, 17 Apr 2013 19:35:39 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta11.emeryville.ca.mail.comcast.net (qmta11.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:211]) by mx1.freebsd.org (Postfix) with ESMTP id A3DA618A for ; Wed, 17 Apr 2013 19:35:39 +0000 (UTC) Received: from omta19.emeryville.ca.mail.comcast.net ([76.96.30.76]) by qmta11.emeryville.ca.mail.comcast.net with comcast id R7De1l0041eYJf8AB7bfqc; Wed, 17 Apr 2013 19:35:39 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta19.emeryville.ca.mail.comcast.net with comcast id R7be1l00i1t3BNj017beii; Wed, 17 Apr 2013 19:35:39 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 8E79373A33; Wed, 17 Apr 2013 12:35:38 -0700 (PDT) Date: Wed, 17 Apr 2013 12:35:38 -0700 From: Jeremy Chadwick To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417193538.GB9331@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417125433.GC30222@caravan.chchile.org> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366227339; bh=GfsjwVqjZnYZ0Rhz5n0JUW3cyCKnZ2D9amEGJ6uekOM=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=JkNaAXLgX7C2P9ebqcb46HDeNcXsbJ5oKey38gxV+gjlf/aX09m5o0dI016uGC71K GI6ACZa3Z83Xus4DI8qKnNeHgeouaQYaUwRqtYyPP+bJS+QlvyhA7P7e5TJhB4psVg AhmUN+DQi2PvYMjRqF73bXwEV/usQHUoEaVegorlmLGaQi+U6iuSH0OJ1nRozzIPYI Yy5SC+htBnge2Hfk36CF2j7X/BKrdkFDta4L/BI8iHcBgRFnLoNmy6F/Whmn4gW95o 2HQ08yhKyGUvqomFBUvw7gtcygSUVqyK0kZjI0qQz4vdOh0wXIyqMyVhK/SfWy1WqO MhkBUhDprzH2g== X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 19:35:39 -0000 On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > Hi Jeremy, > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > Now that this has been enabled by default, I should warn folks of a > > caveat that I found in the buildworld/buildkernel framework. It's > > easiest to explain like this: > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > 2. Add WITHOUT_CDDL=true to /etc/src.conf > > 3. Rebuild + install kernel/world per src/Makefile procedure > > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > > 5. rm -fr /usr/obj/* > > 6. Rebuild world > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > For whatever reason the buildkernel bits make the assumption that > > ctfconvert exists on the system (presumably in $PATH or possibly a > > hard-coded), when ideally it should try to use the recently-built > > version in /usr/obj first. > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > been biten by the bug you describe. > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > probably there problem didn't occur. I can easily verify this in the > jail: > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > Do you have a theory about why you've got the problem while I haven't? > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > I've just removed it and trying to build kernel again. I will spend some time to figure out exactly how to reproduce this. Going from recent memory (~2 weeks ago), I encountered it on my VPS box (which does run ntpd, just FYI): 1. Initially installed with 9.1-RELEASE, 2. Upgraded to stable/9 (using svn), 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, as per instructions in src/Makefile -- which would delete /usr/bin/ctfconvert) 5. Fast forward many months 6. Removed WITHOUT_CDDL=true from src.conf 7. Encountered the above issue ("ctfconvert: not found") during buildkernel 8. Rebuilt kernel again -- same error 9. Removed WITHOUT_ZFS=true from src.conf 10. Rebuilt kernel again -- worked This could mean WITHOUT_ZFS=true has some bearing on this situation, but I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for ctf* utilities. I did poke around the Makefiles and framework a bit but didn't have any epiphanies. Like I said -- I'll try to reproduce the exact scenario. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 19:47:02 2013 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AE26071; Wed, 17 Apr 2013 19:47:02 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id EE06B216; Wed, 17 Apr 2013 19:47:01 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3HJl6IA030644; Wed, 17 Apr 2013 14:47:06 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3HJl6CP030643; Wed, 17 Apr 2013 14:47:06 -0500 (CDT) (envelope-from brooks) Date: Wed, 17 Apr 2013 14:47:06 -0500 From: Brooks Davis To: Jeremy Chadwick Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417194706.GA30583@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <20130417193538.GB9331@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 19:47:02 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > Hi Jeremy, > >=20 > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > >=20 > > > Now that this has been enabled by default, I should warn folks of a > > > caveat that I found in the buildworld/buildkernel framework. It's > > > easiest to explain like this: > > >=20 > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > 2. Add WITHOUT_CDDL=3Dtrue to /etc/src.conf > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > 4. Remove WITHOUT_CDDL=3Dtrue from /etc/src.conf > > > 5. rm -fr /usr/obj/* > > > 6. Rebuild world > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > >=20 > > > For whatever reason the buildkernel bits make the assumption that > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > hard-coded), when ideally it should try to use the recently-built > > > version in /usr/obj first. > >=20 > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > > been biten by the bug you describe. > >=20 > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > > probably there problem didn't occur. I can easily verify this in the > > jail: > >=20 > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/= tail=20 > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > >=20 > >=20 > > Do you have a theory about why you've got the problem while I haven't? > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > >=20 > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > > I've just removed it and trying to build kernel again. >=20 > I will spend some time to figure out exactly how to reproduce this. >=20 > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > (which does run ntpd, just FYI): >=20 > 1. Initially installed with 9.1-RELEASE, > 2. Upgraded to stable/9 (using svn), > 3. WITHOUT_CDDL=3Dtrue and WITHOUT_ZFS=3Dtrue added to /etc/src.conf > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > as per instructions in src/Makefile -- which would delete > /usr/bin/ctfconvert) > 5. Fast forward many months > 6. Removed WITHOUT_CDDL=3Dtrue from src.conf > 7. Encountered the above issue ("ctfconvert: not found") during > buildkernel > 8. Rebuilt kernel again -- same error > 9. Removed WITHOUT_ZFS=3Dtrue from src.conf > 10. Rebuilt kernel again -- worked >=20 > This could mean WITHOUT_ZFS=3Dtrue has some bearing on this situation, but > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > ctf* utilities. I did poke around the Makefiles and framework a bit > but didn't have any epiphanies. >=20 > Like I said -- I'll try to reproduce the exact scenario. Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and cftmerge are bootstrap tools only when they don't exist at all on the host. The code there should be expanded to bootstrap for cases where the installed ones are known to be broken (virtually all prior versions given recent fixes) as well as when they aren't present on the host system. -- Brooks --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRbvw6XY6L6fI4GtQRAiuUAJ4mPg0mE6gpPG7bTmsXJsK3SVC5MQCeKEKg 4CziCb7VgncsyxPGVgCRUmE= =qHIJ -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 21:00:12 2013 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AC967583; Wed, 17 Apr 2013 21:00:12 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 7586F770; Wed, 17 Apr 2013 21:00:12 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id 28175C31D8; Wed, 17 Apr 2013 21:00:11 +0000 (UTC) Date: Wed, 17 Apr 2013 23:00:11 +0200 From: Jeremie Le Hen To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417210011.GD30222@caravan.chchile.org> Mail-Followup-To: Brooks Davis , Jeremy Chadwick , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-9@FreeBSD.org References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417194706.GA30583@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:00:12 -0000 On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > > > I will spend some time to figure out exactly how to reproduce this. > > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > > (which does run ntpd, just FYI): > > > > 1. Initially installed with 9.1-RELEASE, > > 2. Upgraded to stable/9 (using svn), > > 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > > as per instructions in src/Makefile -- which would delete > > /usr/bin/ctfconvert) > > 5. Fast forward many months > > 6. Removed WITHOUT_CDDL=true from src.conf > > 7. Encountered the above issue ("ctfconvert: not found") during > > buildkernel > > 8. Rebuilt kernel again -- same error > > 9. Removed WITHOUT_ZFS=true from src.conf > > 10. Rebuilt kernel again -- worked > > > > This could mean WITHOUT_ZFS=true has some bearing on this situation, but > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > > ctf* utilities. I did poke around the Makefiles and framework a bit > > but didn't have any epiphanies. > > > > Like I said -- I'll try to reproduce the exact scenario. > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > cftmerge are bootstrap tools only when they don't exist at all on the > host. The code there should be expanded to bootstrap for cases where > the installed ones are known to be broken (virtually all prior versions > given recent fixes) as well as when they aren't present on the host > system. Do you have an idea how we can identify whether the installed ctfconvert(1) is broken or not? I think in Jeremy's case we cannot rely on OSRELDATE given that right before he built and installed world with WITHOUT_CDDL, so ctfconvert and OSRELDATE are not in sync. Why not just always add ctfconvert to bootstrap tools when it is needed? I don't know how long it takes to build though, but it is probably nothing compared to LLVM ;-). -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 21:11:07 2013 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BED46CED; Wed, 17 Apr 2013 21:11:07 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 161EC7FB; Wed, 17 Apr 2013 21:11:05 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3HLBAHg031188; Wed, 17 Apr 2013 16:11:10 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3HLBA63031187; Wed, 17 Apr 2013 16:11:10 -0500 (CDT) (envelope-from brooks) Date: Wed, 17 Apr 2013 16:11:10 -0500 From: Brooks Davis To: Brooks Davis , Jeremy Chadwick , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417211110.GA31145@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417210011.GD30222@caravan.chchile.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" Content-Disposition: inline In-Reply-To: <20130417210011.GD30222@caravan.chchile.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 21:11:07 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2013 at 11:00:11PM +0200, Jeremie Le Hen wrote: > On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > >=20 > > > I will spend some time to figure out exactly how to reproduce this. > > >=20 > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS b= ox > > > (which does run ntpd, just FYI): > > >=20 > > > 1. Initially installed with 9.1-RELEASE, > > > 2. Upgraded to stable/9 (using svn), > > > 3. WITHOUT_CDDL=3Dtrue and WITHOUT_ZFS=3Dtrue added to /etc/src.conf > > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-o= ld, > > > as per instructions in src/Makefile -- which would delete > > > /usr/bin/ctfconvert) > > > 5. Fast forward many months > > > 6. Removed WITHOUT_CDDL=3Dtrue from src.conf > > > 7. Encountered the above issue ("ctfconvert: not found") during > > > buildkernel > > > 8. Rebuilt kernel again -- same error > > > 9. Removed WITHOUT_ZFS=3Dtrue from src.conf > > > 10. Rebuilt kernel again -- worked > > >=20 > > > This could mean WITHOUT_ZFS=3Dtrue has some bearing on this situation= , but > > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" = for > > > ctf* utilities. I did poke around the Makefiles and framework a bit > > > but didn't have any epiphanies. > > >=20 > > > Like I said -- I'll try to reproduce the exact scenario. > >=20 > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > > cftmerge are bootstrap tools only when they don't exist at all on the > > host. The code there should be expanded to bootstrap for cases where > > the installed ones are known to be broken (virtually all prior versions > > given recent fixes) as well as when they aren't present on the host > > system. >=20 > Do you have an idea how we can identify whether the installed > ctfconvert(1) is broken or not? I think in Jeremy's case we cannot rely > on OSRELDATE given that right before he built and installed world with > WITHOUT_CDDL, so ctfconvert and OSRELDATE are not in sync. I think we should be able to come up with a fairly reliable set values where it's broken. We can also add a exists(/usr/bin/ctfconvert) to catch the case were the user caused it to not be there. > Why not just always add ctfconvert to bootstrap tools when it is needed? > I don't know how long it takes to build though, but it is probably > nothing compared to LLVM ;-). It's probably not too bad to add, but I don't think it's changing all that quickly so as long as people remember to update Makefile.inc1 it shouldn't too bad. -- Brooks --DocE+STaALJfprDB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRbw/tXY6L6fI4GtQRAgMJAKDGORBqUjaCUN+C7GP1WVqaLNQN8ACgyXl5 x4JVIqBpHCL3OIpwC/AbizE= =dKfW -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 22:56:05 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7AF6680D for ; Wed, 17 Apr 2013 22:56:05 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta12.emeryville.ca.mail.comcast.net (qmta12.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:227]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3DCC00 for ; Wed, 17 Apr 2013 22:56:05 +0000 (UTC) Received: from omta01.emeryville.ca.mail.comcast.net ([76.96.30.11]) by qmta12.emeryville.ca.mail.comcast.net with comcast id R2Am1l0050EPchoACAw4TY; Wed, 17 Apr 2013 22:56:04 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta01.emeryville.ca.mail.comcast.net with comcast id RAw31l0091t3BNj8MAw3LH; Wed, 17 Apr 2013 22:56:03 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 23F7F73A33; Wed, 17 Apr 2013 15:56:03 -0700 (PDT) Date: Wed, 17 Apr 2013 15:56:03 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417225603.GA13720@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417194706.GA30583@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366239364; bh=ZeHXzdu8OY2MCVfYNFD7Ik/+zkN74q4BnTFlKqjjY98=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=LwodMIzmEa/2Ibol89GMFcaKWNb54dpN96obZCOoE1J/zd4naHxRRg4p+z2ImH4FC nNEwFsVWmawyyxdCP0JTy5C+iOsXCQkdtv7u3OTa2jbpbUXZWhaMdt+lykEGZWzege Z69rgQqDvuuW6vTZ+qSpKTfvP5FMxGygMiP4oqfF+owe87E6hm+8yd7RbUIle0aL3r htFNOlmwacrwqPF4YJ8X+AKxZwgrrsUmvSksRgC9GAwp8g82fQHFL08TCbKEQbB36v sFs2pk3AOBtsWbfBGq+Kd4i6LFax2+lJXgx9xI7y+HcD4ybLXgypbFMaPKtj2gl6O6 12QrYXmeBcpzQ== Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 22:56:05 -0000 On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > > Hi Jeremy, > > > > > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > > > > > Now that this has been enabled by default, I should warn folks of a > > > > caveat that I found in the buildworld/buildkernel framework. It's > > > > easiest to explain like this: > > > > > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > > 2. Add WITHOUT_CDDL=true to /etc/src.conf > > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > > > > 5. rm -fr /usr/obj/* > > > > 6. Rebuild world > > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > > > > > For whatever reason the buildkernel bits make the assumption that > > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > > hard-coded), when ideally it should try to use the recently-built > > > > version in /usr/obj first. > > > > > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > > > been biten by the bug you describe. > > > > > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > > > probably there problem didn't occur. I can easily verify this in the > > > jail: > > > > > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail > > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > > > > > > > Do you have a theory about why you've got the problem while I haven't? > > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > > > > > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > > > I've just removed it and trying to build kernel again. > > > > I will spend some time to figure out exactly how to reproduce this. > > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > > (which does run ntpd, just FYI): > > > > 1. Initially installed with 9.1-RELEASE, > > 2. Upgraded to stable/9 (using svn), > > 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > > as per instructions in src/Makefile -- which would delete > > /usr/bin/ctfconvert) > > 5. Fast forward many months > > 6. Removed WITHOUT_CDDL=true from src.conf > > 7. Encountered the above issue ("ctfconvert: not found") during > > buildkernel > > 8. Rebuilt kernel again -- same error > > 9. Removed WITHOUT_ZFS=true from src.conf > > 10. Rebuilt kernel again -- worked > > > > This could mean WITHOUT_ZFS=true has some bearing on this situation, but > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > > ctf* utilities. I did poke around the Makefiles and framework a bit > > but didn't have any epiphanies. > > > > Like I said -- I'll try to reproduce the exact scenario. > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > cftmerge are bootstrap tools only when they don't exist at all on the > host. The code there should be expanded to bootstrap for cases where > the installed ones are known to be broken (virtually all prior versions > given recent fixes) as well as when they aren't present on the host > system. I'm able to reproduce the issue I speak of with 100% reliability. Jeremie, I'm not sure why you're not able to reproduce this, because I can do so reliably/consistently. Below are my notes. This was done on a VMware Workstation VM instance, and I took VM snapshots along the way, so I can "roll back" to almost any phase/step listed below (in case someone wants me to verify what's on the filesystem or use "script" to save a log somewhere or run "make -DA" or something along those lines). 1. Installed 9.1-RELEASE. 2. Added ntpdate_enable and ntpd_enable to /etc/rc.conf, and ran /etc/rc.d/ntpdate start ; /etc/rc.d/ntpd start. 3. Added following to /etc/src.conf: WITHOUT_CDDL=true WITHOUT_CLANG=true WITHOUT_INET6=true WITHOUT_IPFILTER=true WITHOUT_LIB32=true WITHOUT_KERBEROS=true WITHOUT_PAM_SUPPORT=true WITHOUT_SENDMAIL=true WITHOUT_ZFS=true WITH_OPENSSH_NONE_CIPHER=true 4. Installed subversion via ports/pkg_add -r and pulled down a fresh copy of stable/9 (src, r249561) and ports. 5. Verified that /usr/bin/ctfconvert and other CTF utilities exist on system (obviously part of 9.1-RELEASE). 6. Followed instructions in src/Makefile. Shown here: # 1. `cd /usr/src' (or to the directory containing your source tree). # 2. `make buildworld' # 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). # 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC). # [steps 3. & 4. can be combined by using the "kernel" target] # 5. `reboot' (in single user mode: boot -s from the loader prompt). # 6. `mergemaster -p' # 7. `make installworld' # 8. `make delete-old' # 9. `mergemaster' (you may wish to use -i, along with -U or -F). # 10. `reboot' # 11. `make delete-old-libs' (in case no 3rd party program uses them anymore) Had to do "mergemaster -p" prior to installkernel, but Brooks knows about this and it's not relevant to the issue. 7. Verified the "make delete-old" phase deleted /usr/bin/ctfconvert and other CTF utilities; this is normal. 8. Removed WITHOUT_CDDL=true from /etc/src.conf 9. rm -fr /usr/obj/* && cd /usr/src && make -j2 buildworld. 10. Verification of everything at this point -- ctf* utilities are clearly in /usr/obj, but are not in /usr/bin (because of delete-old): root@testbox:/usr/src # find /usr/obj -name "ctf*" -type f -perm 0755 -ls 1783448 728 -rwxr-xr-x 1 root wheel 371738 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfconvert/ctfconvert 1783453 64 -rwxr-xr-x 1 root wheel 28706 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfdump/ctfdump 1783472 168 -rwxr-xr-x 1 root wheel 82711 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfmerge/ctfmerge root@testbox:/usr/src # find /usr/bin -name "ctf*" -type f -perm 0755 -ls root@testbox:/usr/src # 11. make -j2 buildkernel fails: *** [aac_disk.o] Error code 127 cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/cam/cam.c ctfconvert -L VERSION -g cam.o ctfconvert: not found *** [cam.o] Error code 127 ctfconvert -L VERSION -g aac_cam.o ctfconvert: not found *** [aac_cam.o] Error code 127 2 errors *** [all] Error code 2 1 error *** [modules-all] Error code 2 2 errors *** [buildkernel] Error code 2 1 error *** [buildkernel] Error code 2 1 error I'll be doing the following to see where exactly the failure happens since as we know parallel make causes confusing output sometimes, rm -fr /usr/obj/* && make -j2 buildworld && make buildkernel I doubt the parallelism has anything to do with the issue, however -- it seems very clear cut to me that the issue is that buildkernel assumes ctfconvert is in one's $PATH, which is not true if you have an active system with WITHOUT_CDDL=true which you're trying to move *to* have CDDL. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable-9@FreeBSD.ORG Wed Apr 17 23:56:38 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E290325 for ; Wed, 17 Apr 2013 23:56:38 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:16]) by mx1.freebsd.org (Postfix) with ESMTP id 7ED42E71 for ; Wed, 17 Apr 2013 23:56:38 +0000 (UTC) Received: from omta13.emeryville.ca.mail.comcast.net ([76.96.30.52]) by qmta01.emeryville.ca.mail.comcast.net with comcast id R8ra1l00U17UAYkA1BwefD; Wed, 17 Apr 2013 23:56:38 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta13.emeryville.ca.mail.comcast.net with comcast id RBwd1l0061t3BNj8ZBwdHy; Wed, 17 Apr 2013 23:56:37 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 09CF373A33; Wed, 17 Apr 2013 16:56:37 -0700 (PDT) Date: Wed, 17 Apr 2013 16:56:37 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130417235636.GA14262@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417225603.GA13720@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130417225603.GA13720@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366242998; bh=syt4+XY6nuiQyBsKv0iTzcNrJneSLy721Szf+JV+l8A=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=oS8hqoVJjadAR1YkUpscEAfyJQgKjhG5prWgawMNTGKWWxuXoT6fiXwNSYpvtQSYt yYYN5kx9JbwzIcpOhwVHMfjavq2n/8lv2302iP91XTlt2AFIxDcpqd0Z/g8OpV9bxK wZsgKDmh4U5lNLMv7C93cObgIhZtI17shrM4lnYUOy0NG856pdo1y8pCgd0PVCWhL6 Vfloc0prCMUaOr28MHl29RotjjGyFODZZiuajhfV9iEOEv7uZDAi/pTmu0Y7Z2MnFL iKkOf5dvK8lxa6RBpAQ4zreXtlN2rwLPWu40xvDy2S4TRITXgpVRqc/lug01S14kbm x1OjdJ/PNqaNg== Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Apr 2013 23:56:38 -0000 On Wed, Apr 17, 2013 at 03:56:03PM -0700, Jeremy Chadwick wrote: > {snipping for brevity; thread reference is below } > { http://lists.freebsd.org/pipermail/svn-src-stable-9/2013-April/004258.html } > > I'll be doing the following to see where exactly the failure happens > since as we know parallel make causes confusing output sometimes, > > rm -fr /usr/obj/* && make -j2 buildworld && make buildkernel > > I doubt the parallelism has anything to do with the issue, however -- it > seems very clear cut to me that the issue is that buildkernel assumes > ctfconvert is in one's $PATH, which is not true if you have an active > system with WITHOUT_CDDL=true which you're trying to move *to* have > CDDL. Made no difference as I expected. Here's the result: -------------------------------------------------------------- >>> stage 3.2: building everything -------------------------------------------------------------- cd /usr/obj/usr/src/sys/GENERIC; MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac _SHLIBDIRPREFIX=/usr/obj/usr/src/tmp _LDSCRIPTROOT= VERSION="FreeBSD 9.1-STABLE amd64 901504" INSTALL="sh /usr/src/tools/install.sh" PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/usr/obj/usr/src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin COMPILER_TYPE=gcc make KERNEL=kernel all -DNO_MODULES_OBJ cc -c -x assembler-with-cpp -DLOCORE -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror /usr/src/sys/amd64/amd64/locore.S cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror aic7xxx_reg_print.c ctfconvert -L VERSION -g aic7xxx_reg_print.o ctfconvert: No such file or directory *** [aic7xxx_reg_print.o] Error code 1 Stop in /usr/obj/usr/src/sys/GENERIC. *** [buildkernel] Error code 1 Stop in /usr/src. *** [buildkernel] Error code 1 Stop in /usr/src. Apologies for the long paths and verbosity here, but... I started digging through Makefile.inc1, as my first inclination was to figure out why /usr/obj/usr/src/cddl/usr.bin (and usr.sbin) were missing from the PATH definition. I then realised that's not the proper solution, since all of those paths refer to /usr/obj/usr/src/tmp (note the "tmp/" part), and there are no cddl/CTF binaries in there anywhere. All the "tmp" stuff is referred to as $WORLDTMP. To me it looks like whatever populates ${WORLDTMP}/usr/bin and ${WORLDTMP}/usr/sbin is not properly handling (copying) binaries from the /usr/obj/usr/src/cddl/usr.bin and /usr/obj/usr/src/cddl/usr.sbin directory trees into the proper ${WORLDTMP} locations. Confused yet? :-) I'm not even sure where to begin looking for this, nor am I even sure doing that is the proper solution. As an example/test, I've been trying to figure out how addr2line makes it (gets copied**) from one tree/place to another: root@testbox:/usr/src # find /usr/obj -type f -perm 0755 -name "addr2line" -ls 2409648 2112 -rwxr-xr-x 1 root wheel 1033062 Apr 17 15:58 /usr/obj/usr/src/tmp/usr/bin/addr2line 321764 2112 -rwxr-xr-x 1 root wheel 1033062 Apr 17 15:58 /usr/obj/usr/src/tmp/usr/src/gnu/usr.bin/binutils/addr2line/addr2line 2422033 1472 -rwxr-xr-x 1 root wheel 705589 Apr 17 16:08 /usr/obj/usr/src/gnu/usr.bin/binutils/addr2line/addr2line And none of these are what's in /usr/bin (understandably), root@testbox:/usr/src # md5 `find /usr/obj -type f -perm 0755 -name "addr2line" -print` MD5 (/usr/obj/usr/src/tmp/usr/bin/addr2line) = 28d665ae81813d5e2a520498f7f03509 MD5 (/usr/obj/usr/src/tmp/usr/src/gnu/usr.bin/binutils/addr2line/addr2line) = 28d665ae81813d5e2a520498f7f03509 MD5 (/usr/obj/usr/src/gnu/usr.bin/binutils/addr2line/addr2line) = 71b2fde11947153c512617b496a65780 root@testbox:/usr/src # file `find /usr/obj -type f -perm 0755 -name "addr2line" -print` /usr/obj/usr/src/tmp/usr/bin/addr2line: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 9.1 (901504), not stripped /usr/obj/usr/src/tmp/usr/src/gnu/usr.bin/binutils/addr2line/addr2line: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 9.1 (901504), not stripped /usr/obj/usr/src/gnu/usr.bin/binutils/addr2line/addr2line: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), for FreeBSD 9.1 (901504), not stripped ** -- Footnote question: does anyone know why hardlinks aren't used for the identical files? Yes, I'm aware hardlinks can't cross filesystems, but for the first 2 addr2line files I listed above I don't see that being a problem. That could save a lot of disk space, to be honest. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 00:12:33 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1328E783; Thu, 18 Apr 2013 00:12:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0517EF13; Thu, 18 Apr 2013 00:12:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I0CWcL015381; Thu, 18 Apr 2013 00:12:32 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I0CW20015380; Thu, 18 Apr 2013 00:12:32 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304180012.r3I0CW20015380@svn.freebsd.org> From: Kirk McKusick Date: Thu, 18 Apr 2013 00:12:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249597 - stable/9/sys/ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 00:12:33 -0000 Author: mckusick Date: Thu Apr 18 00:12:32 2013 New Revision: 249597 URL: http://svnweb.freebsd.org/changeset/base/249597 Log: MFC of 249064: The code in clear_remove() and clear_inodedeps() skips one entry in the pagedep and inodedep hash tables. An entry in the table is skipped because 'pagedep_hash' and 'inodedep_hash' hold the size of the hash tables - 1. The chance that this would have any operational failure is extremely unlikely. These funtions only need to find a single entry and are only called when there are too many entries. The chance that they would fail because all the entries are on the single skipped hash chain are remote. Submitted by: Pedro Martelletto Reviewed by: kib Modified: stable/9/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_softdep.c Wed Apr 17 22:42:43 2013 (r249596) +++ stable/9/sys/ufs/ffs/ffs_softdep.c Thu Apr 18 00:12:32 2013 (r249597) @@ -13026,9 +13026,9 @@ clear_remove(td) mtx_assert(&lk, MA_OWNED); - for (cnt = 0; cnt < pagedep_hash; cnt++) { + for (cnt = 0; cnt <= pagedep_hash; cnt++) { pagedephd = &pagedep_hashtbl[next++]; - if (next >= pagedep_hash) + if (next > pagedep_hash) next = 0; LIST_FOREACH(pagedep, pagedephd, pd_hash) { if (LIST_EMPTY(&pagedep->pd_dirremhd)) @@ -13090,9 +13090,9 @@ clear_inodedeps(td) * We will then gather up all the inodes in its block * that have dependencies and flush them out. */ - for (cnt = 0; cnt < inodedep_hash; cnt++) { + for (cnt = 0; cnt <= inodedep_hash; cnt++) { inodedephd = &inodedep_hashtbl[next++]; - if (next >= inodedep_hash) + if (next > inodedep_hash) next = 0; if ((inodedep = LIST_FIRST(inodedephd)) != NULL) break; From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 00:53:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E90C5D0D; Thu, 18 Apr 2013 00:53:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB33F7D; Thu, 18 Apr 2013 00:53:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I0rm1a027701; Thu, 18 Apr 2013 00:53:48 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I0rlOW027696; Thu, 18 Apr 2013 00:53:47 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201304180053.r3I0rlOW027696@svn.freebsd.org> From: Kirk McKusick Date: Thu, 18 Apr 2013 00:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249599 - in stable/9/sys: kern sys ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 00:53:49 -0000 Author: mckusick Date: Thu Apr 18 00:53:47 2013 New Revision: 249599 URL: http://svnweb.freebsd.org/changeset/base/249599 Log: MFC of 248561: When renaming a directory from one parent directory to another, we need to call ufs_checkpath() to walk from our new location to the root of the filesystem to ensure that we do not encounter ourselves along the way. Until now, we accomplished this by reading the ".." entries of each directory in our path until we reached the root (or encountered an error). This change tries to avoid the I/O of reading the ".." entries by first looking them up in the name cache and only doing the I/O when the name cache lookup fails. Reviewed by: kib Tested by: Peter Holm Modified: stable/9/sys/kern/vfs_cache.c stable/9/sys/sys/vnode.h stable/9/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/vfs_cache.c ============================================================================== --- stable/9/sys/kern/vfs_cache.c Thu Apr 18 00:14:51 2013 (r249598) +++ stable/9/sys/kern/vfs_cache.c Thu Apr 18 00:53:47 2013 (r249599) @@ -1387,6 +1387,28 @@ vn_fullpath1(struct thread *td, struct v return (0); } +struct vnode * +vn_dir_dd_ino(struct vnode *vp) +{ + struct namecache *ncp; + struct vnode *ddvp; + + ASSERT_VOP_LOCKED(vp, "vn_dir_dd_ino"); + CACHE_RLOCK(); + TAILQ_FOREACH(ncp, &(vp->v_cache_dst), nc_dst) { + if ((ncp->nc_flag & NCF_ISDOTDOT) != 0) + continue; + ddvp = ncp->nc_dvp; + VI_LOCK(ddvp); + CACHE_RUNLOCK(); + if (vget(ddvp, LK_INTERLOCK | LK_SHARED | LK_NOWAIT, curthread)) + return (NULL); + return (ddvp); + } + CACHE_RUNLOCK(); + return (NULL); +} + int vn_commname(struct vnode *vp, char *buf, u_int buflen) { Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Thu Apr 18 00:14:51 2013 (r249598) +++ stable/9/sys/sys/vnode.h Thu Apr 18 00:53:47 2013 (r249599) @@ -621,6 +621,8 @@ int vn_fullpath(struct thread *td, struc char **retbuf, char **freebuf); int vn_fullpath_global(struct thread *td, struct vnode *vn, char **retbuf, char **freebuf); +struct vnode * + vn_dir_dd_ino(struct vnode *vp); int vn_commname(struct vnode *vn, char *buf, u_int buflen); int vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path, u_int pathlen); Modified: stable/9/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_lookup.c Thu Apr 18 00:14:51 2013 (r249598) +++ stable/9/sys/ufs/ufs/ufs_lookup.c Thu Apr 18 00:53:47 2013 (r249599) @@ -1385,13 +1385,29 @@ ufs_dirempty(ip, parentino, cred) } static int -ufs_dir_dd_ino(struct vnode *vp, struct ucred *cred, ino_t *dd_ino) +ufs_dir_dd_ino(struct vnode *vp, struct ucred *cred, ino_t *dd_ino, + struct vnode **dd_vp) { struct dirtemplate dirbuf; + struct vnode *ddvp; int error, namlen; + ASSERT_VOP_LOCKED(vp, "ufs_dir_dd_ino"); if (vp->v_type != VDIR) return (ENOTDIR); + /* + * First check to see if we have it in the name cache. + */ + if ((ddvp = vn_dir_dd_ino(vp)) != NULL) { + KASSERT(ddvp->v_mount == vp->v_mount, + ("ufs_dir_dd_ino: Unexpected mount point crossing")); + *dd_ino = VTOI(ddvp)->i_number; + *dd_vp = ddvp; + return (0); + } + /* + * Have to read the directory. + */ error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf, sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, cred, NOCRED, NULL, NULL); @@ -1409,6 +1425,7 @@ ufs_dir_dd_ino(struct vnode *vp, struct dirbuf.dotdot_name[1] != '.') return (ENOTDIR); *dd_ino = dirbuf.dotdot_ino; + *dd_vp = NULL; return (0); } @@ -1433,7 +1450,7 @@ ufs_checkpath(ino_t source_ino, ino_t pa if (target->i_number == ROOTINO) return (0); for (;;) { - error = ufs_dir_dd_ino(vp, cred, &dd_ino); + error = ufs_dir_dd_ino(vp, cred, &dd_ino, &vp1); if (error != 0) break; if (dd_ino == source_ino) { @@ -1444,22 +1461,16 @@ ufs_checkpath(ino_t source_ino, ino_t pa break; if (dd_ino == parent_ino) break; - error = VFS_VGET(mp, dd_ino, LK_SHARED | LK_NOWAIT, &vp1); - if (error != 0) { - *wait_ino = dd_ino; - break; - } - /* Recheck that ".." still points to vp1 after relock of vp */ - error = ufs_dir_dd_ino(vp, cred, &dd_ino); - if (error != 0) { - vput(vp1); - break; - } - /* Redo the check of ".." if directory was reparented */ - if (dd_ino != VTOI(vp1)->i_number) { - vput(vp1); - continue; + if (vp1 == NULL) { + error = VFS_VGET(mp, dd_ino, LK_SHARED | LK_NOWAIT, + &vp1); + if (error != 0) { + *wait_ino = dd_ino; + break; + } } + KASSERT(dd_ino == VTOI(vp1)->i_number, + ("directory %d reparented\n", VTOI(vp1)->i_number)); if (vp != tvp) vput(vp); vp = vp1; @@ -1467,6 +1478,8 @@ ufs_checkpath(ino_t source_ino, ino_t pa if (error == ENOTDIR) panic("checkpath: .. not a directory\n"); + if (vp1 != NULL) + vput(vp1); if (vp != tvp) vput(vp); return (error); From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 02:21:06 2013 Return-Path: Delivered-To: svn-src-stable-9@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 98D99D4E; Thu, 18 Apr 2013 02:21:06 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id D20482B5; Thu, 18 Apr 2013 02:21:03 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r3I2L3DV032377; Wed, 17 Apr 2013 21:21:03 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r3I2L2R9032376; Wed, 17 Apr 2013 21:21:02 -0500 (CDT) (envelope-from brooks) Date: Wed, 17 Apr 2013 21:21:02 -0500 From: Brooks Davis To: Jeremy Chadwick Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130418022102.GB31612@lor.one-eyed-alien.net> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417225603.GA13720@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: <20130417225603.GA13720@icarus.home.lan> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 02:21:06 -0000 --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 17, 2013 at 03:56:03PM -0700, Jeremy Chadwick wrote: > On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > > On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > > > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > > > Hi Jeremy, > > > >=20 > > > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > >=20 > > > > > Now that this has been enabled by default, I should warn folks of= a > > > > > caveat that I found in the buildworld/buildkernel framework. It's > > > > > easiest to explain like this: > > > > >=20 > > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > > > 2. Add WITHOUT_CDDL=3Dtrue to /etc/src.conf > > > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > > > 4. Remove WITHOUT_CDDL=3Dtrue from /etc/src.conf > > > > > 5. rm -fr /usr/obj/* > > > > > 6. Rebuild world > > > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > >=20 > > > > > For whatever reason the buildkernel bits make the assumption that > > > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > > > hard-coded), when ideally it should try to use the recently-built > > > > > version in /usr/obj first. > > > >=20 > > > > I've tested this is a freshly installed 9.1-RELEASE jail and I have= n't > > > > been biten by the bug you describe. > > > >=20 > > > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this= is > > > > probably there problem didn't occur. I can easily verify this in t= he > > > > jail: > > > >=20 > > > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/= bin/tail=20 > > > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > >=20 > > > >=20 > > > > Do you have a theory about why you've got the problem while I haven= 't? > > > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconver= t/ > > > >=20 > > > > My guess is tha this might happen if you don't have /usr/bin/ctfcon= vert. > > > > I've just removed it and trying to build kernel again. > > >=20 > > > I will spend some time to figure out exactly how to reproduce this. > > >=20 > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS b= ox > > > (which does run ntpd, just FYI): > > >=20 > > > 1. Initially installed with 9.1-RELEASE, > > > 2. Upgraded to stable/9 (using svn), > > > 3. WITHOUT_CDDL=3Dtrue and WITHOUT_ZFS=3Dtrue added to /etc/src.conf > > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-o= ld, > > > as per instructions in src/Makefile -- which would delete > > > /usr/bin/ctfconvert) > > > 5. Fast forward many months > > > 6. Removed WITHOUT_CDDL=3Dtrue from src.conf > > > 7. Encountered the above issue ("ctfconvert: not found") during > > > buildkernel > > > 8. Rebuilt kernel again -- same error > > > 9. Removed WITHOUT_ZFS=3Dtrue from src.conf > > > 10. Rebuilt kernel again -- worked > > >=20 > > > This could mean WITHOUT_ZFS=3Dtrue has some bearing on this situation= , but > > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" = for > > > ctf* utilities. I did poke around the Makefiles and framework a bit > > > but didn't have any epiphanies. > > >=20 > > > Like I said -- I'll try to reproduce the exact scenario. > >=20 > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > > cftmerge are bootstrap tools only when they don't exist at all on the > > host. The code there should be expanded to bootstrap for cases where > > the installed ones are known to be broken (virtually all prior versions > > given recent fixes) as well as when they aren't present on the host > > system. >=20 > I'm able to reproduce the issue I speak of with 100% reliability. > Jeremie, I'm not sure why you're not able to reproduce this, because I > can do so reliably/consistently. The following patch will probably fix the problem. Index: Makefile.inc1 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Makefile.inc1 (revision 249590) +++ Makefile.inc1 (working copy) @@ -1114,9 +1114,7 @@ usr.bin/clang/clang-tblgen .endif =20 -.if ${MK_CDDL} !=3D "no" && \ - ${BOOTSTRAPPING} < 800038 && \ - !(${BOOTSTRAPPING} >=3D 700112 && ${BOOTSTRAPPING} < 799999) +.if ${MK_CDDL} !=3D "no" _dtrace_tools=3D cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif This patch unconditionally bootstraps ctfconvert and ctfmerge unless WITHOUT_CDDL is set. >=20 > 10. Verification of everything at this point -- ctf* utilities are > clearly in /usr/obj, but are not in /usr/bin (because of delete-old): >=20 > root@testbox:/usr/src # find /usr/obj -name "ctf*" -type f -perm 0755 -ls > 1783448 728 -rwxr-xr-x 1 root wheel 3717= 38 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfconvert/ctfconvert > 1783453 64 -rwxr-xr-x 1 root wheel 287= 06 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfdump/ctfdump > 1783472 168 -rwxr-xr-x 1 root wheel 827= 11 Apr 17 15:29 /usr/obj/usr/src/cddl/usr.bin/ctfmerge/ctfmerge > root@testbox:/usr/src # find /usr/bin -name "ctf*" -type f -perm 0755 -ls > root@testbox:/usr/src # The presence of these files is irrelevent. The files we use for bootstrapping or cross compiling live under /usr/obj/usr/src/tmp or equivalent. -- Brooks --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRb1iOXY6L6fI4GtQRArR3AJ0fUQmpj7QiJbTGiOfpEkYd9iokEwCfU+N/ Rjf2AMp0L1UdwBmUNFsfqyc= =Veam -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24-- From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 09:03:07 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 634451AF; Thu, 18 Apr 2013 09:03:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55669688; Thu, 18 Apr 2013 09:03:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I937xm081223; Thu, 18 Apr 2013 09:03:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I937kn081222; Thu, 18 Apr 2013 09:03:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180903.r3I937kn081222@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249609 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:03:07 -0000 Author: mav Date: Thu Apr 18 09:03:06 2013 New Revision: 249609 URL: http://svnweb.freebsd.org/changeset/base/249609 Log: MFC r248695: Remove two bzero()s that are erasing only few more bytes then set later. Modified: stable/9/sys/cam/ata/ata_all.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.c ============================================================================== --- stable/9/sys/cam/ata/ata_all.c Thu Apr 18 07:09:27 2013 (r249608) +++ stable/9/sys/cam/ata/ata_all.c Thu Apr 18 09:03:06 2013 (r249609) @@ -367,7 +367,7 @@ void ata_48bit_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint16_t features, uint64_t lba, uint16_t sector_count) { - bzero(&ataio->cmd, sizeof(ataio->cmd)); + ataio->cmd.flags = CAM_ATAIO_48BIT; if (cmd == ATA_READ_DMA48 || cmd == ATA_READ_DMA_QUEUED48 || @@ -391,13 +391,14 @@ ata_48bit_cmd(struct ccb_ataio *ataio, u ataio->cmd.features_exp = features >> 8; ataio->cmd.sector_count = sector_count; ataio->cmd.sector_count_exp = sector_count >> 8; + ataio->cmd.control = 0; } void ata_ncq_cmd(struct ccb_ataio *ataio, uint8_t cmd, uint64_t lba, uint16_t sector_count) { - bzero(&ataio->cmd, sizeof(ataio->cmd)); + ataio->cmd.flags = CAM_ATAIO_48BIT | CAM_ATAIO_FPDMA; ataio->cmd.command = cmd; ataio->cmd.features = sector_count; @@ -409,6 +410,9 @@ ata_ncq_cmd(struct ccb_ataio *ataio, uin ataio->cmd.lba_mid_exp = lba >> 32; ataio->cmd.lba_high_exp = lba >> 40; ataio->cmd.features_exp = sector_count >> 8; + ataio->cmd.sector_count = 0; + ataio->cmd.sector_count_exp = 0; + ataio->cmd.control = 0; } void From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 09:40:35 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D259595F; Thu, 18 Apr 2013 09:40:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3D2D8B5; Thu, 18 Apr 2013 09:40:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I9eZIM093265; Thu, 18 Apr 2013 09:40:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I9eZW0093262; Thu, 18 Apr 2013 09:40:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180940.r3I9eZW0093262@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249610 - in stable/9/sys/cam: . ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:40:36 -0000 Author: mav Date: Thu Apr 18 09:40:34 2013 New Revision: 249610 URL: http://svnweb.freebsd.org/changeset/base/249610 Log: MFC r248868, r248874: Implement CAM_PERIPH_FOREACH() macro, safely iterating over the list of driver's periphs, acquiring and releaseing periph references while doing it. Use it to iterate over the lists of ada and da periphs when flushing caches and putting devices to sleep on shutdown and suspend. Previous code could panic in theory if some device disappear in the middle of the process. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/cam_periph.h stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:03:06 2013 (r249609) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:40:34 2013 (r249610) @@ -1827,7 +1827,7 @@ adaflush(void) struct ada_softc *softc; int error; - TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &adadriver) { union ccb ccb; /* If we paniced with lock held - not recurse here. */ @@ -1881,7 +1881,7 @@ adaspindown(uint8_t cmd, int flags) struct ada_softc *softc; int error; - TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &adadriver) { union ccb ccb; /* If we paniced with lock held - not recurse here. */ @@ -1954,7 +1954,7 @@ adaresume(void *arg) if (ada_spindown_suspend == 0) return; - TAILQ_FOREACH(periph, &adadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &adadriver) { cam_periph_lock(periph); softc = (struct ada_softc *)periph->softc; /* Modified: stable/9/sys/cam/cam_periph.h ============================================================================== --- stable/9/sys/cam/cam_periph.h Thu Apr 18 09:03:06 2013 (r249609) +++ stable/9/sys/cam/cam_periph.h Thu Apr 18 09:40:34 2013 (r249610) @@ -36,6 +36,8 @@ #ifdef _KERNEL +#include + struct devstat; extern struct cam_periph *xpt_periph; @@ -209,5 +211,42 @@ cam_periph_sleep(struct cam_periph *peri return (msleep(chan, periph->sim->mtx, priority, wmesg, timo)); } +static inline struct cam_periph * +cam_periph_acquire_first(struct periph_driver *driver) +{ + struct cam_periph *periph; + + xpt_lock_buses(); + periph = TAILQ_FIRST(&driver->units); + while (periph != NULL && (periph->flags & CAM_PERIPH_INVALID) != 0) + periph = TAILQ_NEXT(periph, unit_links); + if (periph != NULL) + periph->refcount++; + xpt_unlock_buses(); + return (periph); +} + +static inline struct cam_periph * +cam_periph_acquire_next(struct cam_periph *pperiph) +{ + struct cam_periph *periph = pperiph; + + mtx_assert(pperiph->sim->mtx, MA_NOTOWNED); + xpt_lock_buses(); + do { + periph = TAILQ_NEXT(periph, unit_links); + } while (periph != NULL && (periph->flags & CAM_PERIPH_INVALID) != 0); + if (periph != NULL) + periph->refcount++; + xpt_unlock_buses(); + cam_periph_release(pperiph); + return (periph); +} + +#define CAM_PERIPH_FOREACH(periph, driver) \ + for ((periph) = cam_periph_acquire_first(driver); \ + (periph) != NULL; \ + (periph) = cam_periph_acquire_next(periph)) + #endif /* _KERNEL */ #endif /* _CAM_CAM_PERIPH_H */ Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:03:06 2013 (r249609) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:40:34 2013 (r249610) @@ -2836,7 +2836,7 @@ dashutdown(void * arg, int howto) struct da_softc *softc; int error; - TAILQ_FOREACH(periph, &dadriver.units, unit_links) { + CAM_PERIPH_FOREACH(periph, &dadriver) { union ccb ccb; cam_periph_lock(periph); From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 09:44:01 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1B945B3F; Thu, 18 Apr 2013 09:44:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F25418FB; Thu, 18 Apr 2013 09:44:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I9i0Dn093970; Thu, 18 Apr 2013 09:44:00 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I9i05t093967; Thu, 18 Apr 2013 09:44:00 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180944.r3I9i05t093967@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249611 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:44:01 -0000 Author: mav Date: Thu Apr 18 09:44:00 2013 New Revision: 249611 URL: http://svnweb.freebsd.org/changeset/base/249611 Log: MFC r248872, r249048: Make pre-shutdown flush and spindown routines to not use xpt_polled_action(), but execute the commands in regular way. There is no any reason to cook CPU while the system is still fully operational. After this change polling in CAM is used only for kernel dumping. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:40:34 2013 (r249610) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 09:44:00 2013 (r249611) @@ -1825,11 +1825,10 @@ adaflush(void) { struct cam_periph *periph; struct ada_softc *softc; + union ccb *ccb; int error; CAM_PERIPH_FOREACH(periph, &adadriver) { - union ccb ccb; - /* If we paniced with lock held - not recurse here. */ if (cam_periph_owned(periph)) continue; @@ -1845,10 +1844,8 @@ adaflush(void) continue; } - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - - ccb.ccb_h.ccb_state = ADA_CCB_DUMP; - cam_fill_ataio(&ccb.ataio, + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + cam_fill_ataio(&ccb->ataio, 0, adadone, CAM_DIR_NONE, @@ -1856,20 +1853,17 @@ adaflush(void) NULL, 0, ada_default_timeout*1000); - if (softc->flags & ADA_FLAG_CAN_48BIT) - ata_48bit_cmd(&ccb.ataio, ATA_FLUSHCACHE48, 0, 0, 0); + ata_48bit_cmd(&ccb->ataio, ATA_FLUSHCACHE48, 0, 0, 0); else - ata_28bit_cmd(&ccb.ataio, ATA_FLUSHCACHE, 0, 0, 0); - xpt_polled_action(&ccb); + ata_28bit_cmd(&ccb->ataio, ATA_FLUSHCACHE, 0, 0, 0); - error = cam_periph_error(&ccb, - 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, - /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + error = cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, + softc->disk->d_devstat); if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); + xpt_release_ccb(ccb); cam_periph_unlock(periph); } } @@ -1879,11 +1873,10 @@ adaspindown(uint8_t cmd, int flags) { struct cam_periph *periph; struct ada_softc *softc; + union ccb *ccb; int error; CAM_PERIPH_FOREACH(periph, &adadriver) { - union ccb ccb; - /* If we paniced with lock held - not recurse here. */ if (cam_periph_owned(periph)) continue; @@ -1900,10 +1893,8 @@ adaspindown(uint8_t cmd, int flags) if (bootverbose) xpt_print(periph->path, "spin-down\n"); - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - - ccb.ccb_h.ccb_state = ADA_CCB_DUMP; - cam_fill_ataio(&ccb.ataio, + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + cam_fill_ataio(&ccb->ataio, 0, adadone, CAM_DIR_NONE | flags, @@ -1911,17 +1902,14 @@ adaspindown(uint8_t cmd, int flags) NULL, 0, ada_default_timeout*1000); + ata_28bit_cmd(&ccb->ataio, cmd, 0, 0, 0); - ata_28bit_cmd(&ccb.ataio, cmd, 0, 0, 0); - xpt_polled_action(&ccb); - - error = cam_periph_error(&ccb, - 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, - /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + error = cam_periph_runccb(ccb, adaerror, /*cam_flags*/0, + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY, + softc->disk->d_devstat); if (error != 0) xpt_print(periph->path, "Spin-down disk failed\n"); + xpt_release_ccb(ccb); cam_periph_unlock(periph); } } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:40:34 2013 (r249610) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 09:44:00 2013 (r249611) @@ -2834,11 +2834,10 @@ dashutdown(void * arg, int howto) { struct cam_periph *periph; struct da_softc *softc; + union ccb *ccb; int error; CAM_PERIPH_FOREACH(periph, &dadriver) { - union ccb ccb; - cam_periph_lock(periph); softc = (struct da_softc *)periph->softc; @@ -2852,10 +2851,8 @@ dashutdown(void * arg, int howto) continue; } - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - - ccb.ccb_h.ccb_state = DA_CCB_DUMP; - scsi_synchronize_cache(&ccb.csio, + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); + scsi_synchronize_cache(&ccb->csio, /*retries*/0, /*cbfcnp*/dadone, MSG_SIMPLE_Q_TAG, @@ -2864,15 +2861,12 @@ dashutdown(void * arg, int howto) SSD_FULL_SIZE, 60 * 60 * 1000); - xpt_polled_action(&ccb); - - error = cam_periph_error(&ccb, - 0, SF_NO_RECOVERY | SF_NO_RETRY | SF_QUIET_IR, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, - /*reduction*/0, /*timeout*/0, /*getcount_only*/0); + error = cam_periph_runccb(ccb, daerror, /*cam_flags*/0, + /*sense_flags*/ SF_NO_RECOVERY | SF_NO_RETRY | SF_QUIET_IR, + softc->disk->d_devstat); if (error != 0) xpt_print(periph->path, "Synchronize cache failed\n"); + xpt_release_ccb(ccb); cam_periph_unlock(periph); } } From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 09:58:31 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6DA3EFC1; Thu, 18 Apr 2013 09:58:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F68D990; Thu, 18 Apr 2013 09:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3I9wVSv097722; Thu, 18 Apr 2013 09:58:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3I9wVwR097721; Thu, 18 Apr 2013 09:58:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304180958.r3I9wVwR097721@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 09:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249612 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 09:58:31 -0000 Author: mav Date: Thu Apr 18 09:58:30 2013 New Revision: 249612 URL: http://svnweb.freebsd.org/changeset/base/249612 Log: MFC r249091: Use xpt_lock_buses() instead of equivalent mtx_lock(&xsoftc.xpt_topo_lock) to unify the code. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Apr 18 09:44:00 2013 (r249611) +++ stable/9/sys/cam/cam_xpt.c Thu Apr 18 09:58:30 2013 (r249612) @@ -653,7 +653,7 @@ xptioctl(struct cdev *dev, u_long cmd, c } /* Keep the list from changing while we traverse it */ - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); ptstartover: cur_generation = xsoftc.xpt_generation; @@ -663,7 +663,7 @@ ptstartover: break; if (*p_drv == NULL) { - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); ccb->ccb_h.status = CAM_REQ_CMP_ERR; ccb->cgdl.status = CAM_GDEVLIST_ERROR; *ccb->cgdl.periph_name = '\0'; @@ -685,8 +685,8 @@ ptstartover: if (periph->unit_number == unit) { break; } else if (--splbreaknum == 0) { - mtx_unlock(&xsoftc.xpt_topo_lock); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); + xpt_lock_buses(); splbreaknum = 100; if (cur_generation != xsoftc.xpt_generation) goto ptstartover; @@ -775,7 +775,7 @@ ptstartover: "your kernel config file\n"); } } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); break; } default: @@ -1023,9 +1023,9 @@ xpt_add_periph(struct cam_periph *periph SLIST_INSERT_HEAD(periph_head, periph, periph_links); } - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); xsoftc.xpt_generation++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (status); } @@ -1053,12 +1053,12 @@ xpt_remove_periph(struct cam_periph *per } if (topology_lock_held == 0) - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); xsoftc.xpt_generation++; if (topology_lock_held == 0) - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); } @@ -2030,7 +2030,7 @@ xptbustraverse(struct cam_eb *start_bus, retval = 1; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xsoftc.xpt_busses)); bus != NULL; bus = next_bus) { @@ -2041,22 +2041,22 @@ xptbustraverse(struct cam_eb *start_bus, * XXX The locking here is obviously very complex. We * should work to simplify it. */ - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); CAM_SIM_LOCK(bus->sim); retval = tr_func(bus, arg); CAM_SIM_UNLOCK(bus->sim); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); next_bus = TAILQ_NEXT(bus, links); - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); xpt_release_bus(bus); if (retval == 0) return(retval); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return(retval); } @@ -2072,7 +2072,7 @@ xpt_sim_opened(struct cam_sim *sim) KASSERT(sim->refcount >= 1, ("sim->refcount >= 1")); mtx_assert(sim->mtx, MA_OWNED); - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); TAILQ_FOREACH(bus, &xsoftc.xpt_busses, links) { if (bus->sim != sim) continue; @@ -2082,7 +2082,7 @@ xpt_sim_opened(struct cam_sim *sim) SLIST_FOREACH(periph, &device->periphs, periph_links) { if (periph->refcount > 0) { - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (1); } } @@ -2090,7 +2090,7 @@ xpt_sim_opened(struct cam_sim *sim) } } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (0); } @@ -3549,14 +3549,14 @@ xpt_path_counts(struct cam_path *path, u uint32_t *periph_ref, uint32_t *target_ref, uint32_t *device_ref) { - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); if (bus_ref) { if (path->bus) *bus_ref = path->bus->refcount; else *bus_ref = 0; } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); if (periph_ref) { if (path->periph) *periph_ref = path->periph->refcount; @@ -3872,7 +3872,7 @@ xpt_bus_register(struct cam_sim *sim, de new_bus->refcount = 1; /* Held until a bus_deregister event */ new_bus->generation = 0; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); while (old_bus != NULL && old_bus->path_id < new_bus->path_id) @@ -3882,7 +3882,7 @@ xpt_bus_register(struct cam_sim *sim, de else TAILQ_INSERT_TAIL(&xsoftc.xpt_busses, new_bus, links); xsoftc.bus_generation++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); /* * Set a default transport so that a PATH_INQ can be issued to @@ -3968,7 +3968,7 @@ xptnextfreepathid(void) const char *strval; pathid = 0; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); bus = TAILQ_FIRST(&xsoftc.xpt_busses); retry: /* Find an unoccupied pathid */ @@ -3977,7 +3977,7 @@ retry: pathid++; bus = TAILQ_NEXT(bus, links); } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); /* * Ensure that this pathid is not reserved for @@ -3986,7 +3986,7 @@ retry: if (resource_string_value("scbus", pathid, "at", &strval) == 0) { ++pathid; /* Start the search over */ - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); goto retry; } return (pathid); @@ -4435,17 +4435,17 @@ static void xpt_release_bus(struct cam_eb *bus) { - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); KASSERT(bus->refcount >= 1, ("bus->refcount >= 1")); if ((--bus->refcount == 0) && (TAILQ_FIRST(&bus->et_entries) == NULL)) { TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); xsoftc.bus_generation++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); cam_sim_release(bus->sim); free(bus, M_CAMXPT); } else - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); } static struct cam_et * @@ -4469,9 +4469,9 @@ xpt_alloc_target(struct cam_eb *bus, tar * Hold a reference to our parent bus so it * will not go away before we do. */ - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); bus->refcount++; - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); /* Insertion sort into our bus's target list */ cur_target = TAILQ_FIRST(&bus->et_entries); @@ -4661,7 +4661,7 @@ xpt_find_bus(path_id_t path_id) { struct cam_eb *bus; - mtx_lock(&xsoftc.xpt_topo_lock); + xpt_lock_buses(); for (bus = TAILQ_FIRST(&xsoftc.xpt_busses); bus != NULL; bus = TAILQ_NEXT(bus, links)) { @@ -4670,7 +4670,7 @@ xpt_find_bus(path_id_t path_id) break; } } - mtx_unlock(&xsoftc.xpt_topo_lock); + xpt_unlock_buses(); return (bus); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:01:44 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8D2491EA; Thu, 18 Apr 2013 10:01:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 640209A6; Thu, 18 Apr 2013 10:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA1iwv099991; Thu, 18 Apr 2013 10:01:44 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA1i77099990; Thu, 18 Apr 2013 10:01:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181001.r3IA1i77099990@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249613 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:01:44 -0000 Author: mav Date: Thu Apr 18 10:01:43 2013 New Revision: 249613 URL: http://svnweb.freebsd.org/changeset/base/249613 Log: MFC r249104: Move CAM_DEBUG_CDB messages from the point of queuing to the point of sending to SIM. That allows to inspect real requests execution order, respecting priorities, freezing, etc. Modified: stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Apr 18 09:58:30 2013 (r249612) +++ stable/9/sys/cam/cam_xpt.c Thu Apr 18 10:01:43 2013 (r249613) @@ -2462,7 +2462,6 @@ xpt_action(union ccb *start_ccb) void xpt_action_default(union ccb *start_ccb) { - char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; struct cam_path *path; path = start_ccb->ccb_h.path; @@ -2498,11 +2497,6 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.target_lun << 5; } start_ccb->csio.scsi_status = SCSI_STATUS_OK; - CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. CDB: %s\n", - scsi_op_desc(start_ccb->csio.cdb_io.cdb_bytes[0], - &path->device->inq_data), - scsi_cdb_string(start_ccb->csio.cdb_io.cdb_bytes, - cdb_str, sizeof(cdb_str)))); } /* FALLTHROUGH */ case XPT_TARGET_IO: @@ -2511,13 +2505,8 @@ xpt_action_default(union ccb *start_ccb) start_ccb->csio.resid = 0; /* FALLTHROUGH */ case XPT_ATA_IO: - if (start_ccb->ccb_h.func_code == XPT_ATA_IO) { + if (start_ccb->ccb_h.func_code == XPT_ATA_IO) start_ccb->ataio.resid = 0; - CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. ACB: %s\n", - ata_op_string(&start_ccb->ataio.cmd), - ata_cmd_string(&start_ccb->ataio.cmd, - cdb_str, sizeof(cdb_str)))); - } /* FALLTHROUGH */ case XPT_RESET_DEV: case XPT_ENG_EXEC: @@ -3260,6 +3249,7 @@ static void xpt_run_dev_sendq(struct cam_eb *bus) { struct cam_devq *devq; + char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1]; CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_dev_sendq\n")); @@ -3341,6 +3331,26 @@ xpt_run_dev_sendq(struct cam_eb *bus) work_ccb->ccb_h.flags &= ~CAM_TAG_ACTION_VALID; } + switch (work_ccb->ccb_h.func_code) { + case XPT_SCSI_IO: + CAM_DEBUG(work_ccb->ccb_h.path, + CAM_DEBUG_CDB,("%s. CDB: %s\n", + scsi_op_desc(work_ccb->csio.cdb_io.cdb_bytes[0], + &device->inq_data), + scsi_cdb_string(work_ccb->csio.cdb_io.cdb_bytes, + cdb_str, sizeof(cdb_str)))); + break; + case XPT_ATA_IO: + CAM_DEBUG(work_ccb->ccb_h.path, + CAM_DEBUG_CDB,("%s. ACB: %s\n", + ata_op_string(&work_ccb->ataio.cmd), + ata_cmd_string(&work_ccb->ataio.cmd, + cdb_str, sizeof(cdb_str)))); + break; + default: + break; + } + /* * Device queues can be shared among multiple sim instances * that reside on different busses. Use the SIM in the queue From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:03:45 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E965737D; Thu, 18 Apr 2013 10:03:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBC349BE; Thu, 18 Apr 2013 10:03:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA3jS4000501; Thu, 18 Apr 2013 10:03:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA3iP4000498; Thu, 18 Apr 2013 10:03:44 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181003.r3IA3iP4000498@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249614 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:03:46 -0000 Author: mav Date: Thu Apr 18 10:03:44 2013 New Revision: 249614 URL: http://svnweb.freebsd.org/changeset/base/249614 Log: MFC r249105: Remove extra NULL checks. d_drv1 can never be NULL during periph life cycle. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:01:43 2013 (r249613) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:03:44 2013 (r249614) @@ -528,10 +528,6 @@ adaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) { - return (ENXIO); - } - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { return(ENXIO); } @@ -567,9 +563,6 @@ adaclose(struct disk *dp) union ccb *ccb; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); @@ -647,10 +640,6 @@ adastrategy(struct bio *bp) struct ada_softc *softc; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } softc = (struct ada_softc *)periph->softc; cam_periph_lock(periph); @@ -698,8 +687,6 @@ adadump(void *arg, void *virtual, vm_off dp = arg; periph = dp->d_drv1; - if (periph == NULL) - return (ENXIO); softc = (struct ada_softc *)periph->softc; cam_periph_lock(periph); secsize = softc->params.secsize; @@ -1028,9 +1015,6 @@ adagetattr(struct bio *bp) struct cam_periph *periph; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, periph->path); Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:01:43 2013 (r249613) +++ stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:03:44 2013 (r249614) @@ -386,7 +386,6 @@ cddiskgonecb(struct disk *dp) struct cam_periph *periph; periph = (struct cam_periph *)dp->d_drv1; - cam_periph_release(periph); } @@ -1073,9 +1072,6 @@ cdopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct cd_softc *)periph->softc; if (cam_periph_acquire(periph) != CAM_REQ_CMP) @@ -1120,9 +1116,6 @@ cdclose(struct disk *dp) struct cd_softc *softc; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (ENXIO); - softc = (struct cd_softc *)periph->softc; cam_periph_lock(periph); @@ -1473,11 +1466,6 @@ cdstrategy(struct bio *bp) struct cd_softc *softc; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } - cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("cdstrategy(%p)\n", bp)); @@ -1971,9 +1959,6 @@ cdioctl(struct disk *dp, u_long cmd, voi int nocopyout, error = 0; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return(ENXIO); - cam_periph_lock(periph); softc = (struct cd_softc *)periph->softc; Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:01:43 2013 (r249613) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:03:44 2013 (r249614) @@ -959,10 +959,6 @@ daopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) { - return (ENXIO); - } - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { return (ENXIO); } @@ -1024,9 +1020,6 @@ daclose(struct disk *dp) struct da_softc *softc; periph = (struct cam_periph *)dp->d_drv1; - if (periph == NULL) - return (0); - cam_periph_lock(periph); if (cam_periph_hold(periph, PRIBIO) != 0) { cam_periph_unlock(periph); @@ -1115,10 +1108,6 @@ dastrategy(struct bio *bp) struct da_softc *softc; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) { - biofinish(bp, NULL, ENXIO); - return; - } softc = (struct da_softc *)periph->softc; cam_periph_lock(periph); @@ -1166,8 +1155,6 @@ dadump(void *arg, void *virtual, vm_offs dp = arg; periph = dp->d_drv1; - if (periph == NULL) - return (ENXIO); softc = (struct da_softc *)periph->softc; cam_periph_lock(periph); secsize = softc->params.secsize; @@ -1242,9 +1229,6 @@ dagetattr(struct bio *bp) struct cam_periph *periph; periph = (struct cam_periph *)bp->bio_disk->d_drv1; - if (periph == NULL) - return (ENXIO); - cam_periph_lock(periph); ret = xpt_getattr(bp->bio_data, bp->bio_length, bp->bio_attribute, periph->path); @@ -1287,7 +1271,6 @@ dadiskgonecb(struct disk *dp) struct cam_periph *periph; periph = (struct cam_periph *)dp->d_drv1; - cam_periph_release(periph); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:06:53 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF8505ED; Thu, 18 Apr 2013 10:06:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B16AB9DB; Thu, 18 Apr 2013 10:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IA6rJY001231; Thu, 18 Apr 2013 10:06:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IA6qHu001227; Thu, 18 Apr 2013 10:06:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181006.r3IA6qHu001227@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249615 - in stable/9/sys/cam: ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:06:53 -0000 Author: mav Date: Thu Apr 18 10:06:52 2013 New Revision: 249615 URL: http://svnweb.freebsd.org/changeset/base/249615 Log: MFC r249106: Replace some direct mutex operations with wrappers. Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_cd.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/cam/scsi/scsi_pass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/ata/ata_da.c Thu Apr 18 10:06:52 2013 (r249615) @@ -1104,7 +1104,7 @@ adaregister(struct cam_periph *periph, v * Register this media as a disk */ (void)cam_periph_hold(periph, PRIBIO); - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); snprintf(announce_buf, sizeof(announce_buf), "kern.cam.ada.%d.quirks", periph->unit_number); quirks = softc->quirks; @@ -1195,7 +1195,7 @@ adaregister(struct cam_periph *periph, v } else legacy_id = -1; disk_create(softc->disk, DISK_VERSION); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); cam_periph_unhold(periph); dp = &softc->params; Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_cd.c Thu Apr 18 10:06:52 2013 (r249615) @@ -1446,7 +1446,7 @@ cdgetccb(struct cam_periph *periph, u_in softc->changer->flags |= CHANGER_MANUAL_CALL; cdrunchangerqueue(softc->changer); } else - msleep(&softc->changer, periph->sim->mtx, + cam_periph_sleep(periph, &softc->changer, PRIBIO, "cgticb", 0); } } Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Apr 18 10:06:52 2013 (r249615) @@ -985,7 +985,7 @@ daopen(struct disk *dp) dareprobe(periph); /* Wait for the disk size update. */ - error = msleep(&softc->disk->d_mediasize, periph->sim->mtx, PRIBIO, + error = cam_periph_sleep(periph, &softc->disk->d_mediasize, PRIBIO, "dareprobe", 0); if (error != 0) xpt_print(periph->path, "unable to retrieve capacity data"); @@ -1676,7 +1676,7 @@ daregister(struct cam_periph *periph, vo (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL, dasendorderedtag, softc); - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); /* * RBC devices don't have to support READ(6), only READ(10). */ @@ -1759,12 +1759,12 @@ daregister(struct cam_periph *periph, vo if (cam_periph_acquire(periph) != CAM_REQ_CMP) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); return (CAM_REQ_CMP_ERR); } disk_create(softc->disk, DISK_VERSION); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); /* * Add async callbacks for events of interest. Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Thu Apr 18 10:03:44 2013 (r249614) +++ stable/9/sys/cam/scsi/scsi_pass.c Thu Apr 18 10:06:52 2013 (r249615) @@ -381,7 +381,7 @@ passregister(struct cam_periph *periph, * know what the blocksize of this device is, if * it even has a blocksize. */ - mtx_unlock(periph->sim->mtx); + cam_periph_unlock(periph); no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0; softc->device_stats = devstat_new_entry("pass", periph->unit_number, 0, @@ -417,7 +417,7 @@ passregister(struct cam_periph *periph, */ dev_ref(softc->dev); - mtx_lock(periph->sim->mtx); + cam_periph_lock(periph); softc->dev->si_drv1 = periph; TASK_INIT(&softc->add_physpath_task, /*priority*/0, From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:40:41 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9A3FEE10; Thu, 18 Apr 2013 10:40:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8AB02B38; Thu, 18 Apr 2013 10:40:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAefBM012738; Thu, 18 Apr 2013 10:40:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAeeJP012733; Thu, 18 Apr 2013 10:40:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181040.r3IAeeJP012733@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249617 - in stable/9/sys/cam: . ata scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:40:41 -0000 Author: mav Date: Thu Apr 18 10:40:40 2013 New Revision: 249617 URL: http://svnweb.freebsd.org/changeset/base/249617 Log: MFC r249108: - Unify device to target insertion inside xpt_alloc_device() instead of duplicating it three times. - Reformat code to reduce indentation. - Add lock assertions to every point where reference counters are modified. - When reference counters are reaching zero, add assertions that there are no children items left. - Add a bit more locking to the xptpdperiphtraverse(). Modified: stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_sim.c stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/ata/ata_xpt.c Thu Apr 18 10:40:40 2013 (r249617) @@ -1534,7 +1534,6 @@ ata_alloc_device(struct cam_eb *bus, str struct cam_path path; struct ata_quirk_entry *quirk; struct cam_ed *device; - struct cam_ed *cur_device; device = xpt_alloc_device(bus, target, lun_id); if (device == NULL) @@ -1559,16 +1558,6 @@ ata_alloc_device(struct cam_eb *bus, str * do. */ bus->sim->max_ccbs += device->ccbq.devq_openings; - /* Insertion sort into our target's device list */ - cur_device = TAILQ_FIRST(&target->ed_entries); - while (cur_device != NULL && cur_device->lun_id < lun_id) - cur_device = TAILQ_NEXT(cur_device, links); - if (cur_device != NULL) { - TAILQ_INSERT_BEFORE(cur_device, device, links); - } else { - TAILQ_INSERT_TAIL(&target->ed_entries, device, links); - } - target->generation++; if (lun_id != CAM_LUN_WILDCARD) { xpt_compile_path(&path, NULL, Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/cam_periph.c Thu Apr 18 10:40:40 2013 (r249617) @@ -378,13 +378,10 @@ cam_periph_acquire(struct cam_periph *pe void cam_periph_release_locked_buses(struct cam_periph *periph) { - if (periph->refcount != 0) { - periph->refcount--; - } else { - panic("%s: release of %p when refcount is zero\n ", __func__, - periph); - } - if (periph->refcount == 0 + + mtx_assert(periph->sim->mtx, MA_OWNED); + KASSERT(periph->refcount >= 1, ("periph->refcount >= 1")); + if (--periph->refcount == 0 && (periph->flags & CAM_PERIPH_INVALID)) { camperiphfree(periph); } @@ -583,6 +580,7 @@ cam_periph_invalidate(struct cam_periph { CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); + mtx_assert(periph->sim->mtx, MA_OWNED); /* * We only call this routine the first time a peripheral is * invalidated. @@ -605,6 +603,7 @@ camperiphfree(struct cam_periph *periph) { struct periph_driver **p_drv; + mtx_assert(periph->sim->mtx, MA_OWNED); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0) break; Modified: stable/9/sys/cam/cam_sim.c ============================================================================== --- stable/9/sys/cam/cam_sim.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/cam_sim.c Thu Apr 18 10:40:40 2013 (r249617) @@ -109,6 +109,7 @@ cam_sim_free(struct cam_sim *sim, int fr union ccb *ccb; int error; + mtx_assert(sim->mtx, MA_OWNED); sim->refcount--; if (sim->refcount > 0) { error = msleep(sim, sim->mtx, PRIBIO, "simfree", 0); Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/cam_xpt.c Thu Apr 18 10:40:40 2013 (r249617) @@ -2101,6 +2101,7 @@ xpttargettraverse(struct cam_eb *bus, st struct cam_et *target, *next_target; int retval; + mtx_assert(bus->sim->mtx, MA_OWNED); retval = 1; for (target = (start_target ? start_target : TAILQ_FIRST(&bus->et_entries)); @@ -2128,6 +2129,7 @@ xptdevicetraverse(struct cam_et *target, struct cam_ed *device, *next_device; int retval; + mtx_assert(target->bus->sim->mtx, MA_OWNED); retval = 1; for (device = (start_device ? start_device : TAILQ_FIRST(&target->ed_entries)); @@ -2166,6 +2168,7 @@ xptperiphtraverse(struct cam_ed *device, retval = 1; + mtx_assert(device->sim->mtx, MA_OWNED); xpt_lock_buses(); for (periph = (start_periph ? start_periph : SLIST_FIRST(&device->periphs)); @@ -2247,6 +2250,7 @@ xptpdperiphtraverse(struct periph_driver xpt_periphfunc_t *tr_func, void *arg) { struct cam_periph *periph, *next_periph; + struct cam_sim *sim; int retval; retval = 1; @@ -2275,7 +2279,10 @@ xptpdperiphtraverse(struct periph_driver * traversal function, so it can't go away. */ periph->refcount++; - + sim = periph->sim; + xpt_unlock_buses(); + CAM_SIM_LOCK(sim); + xpt_lock_buses(); retval = tr_func(periph, arg); /* @@ -2285,6 +2292,7 @@ xptpdperiphtraverse(struct periph_driver next_periph = TAILQ_NEXT(periph, unit_links); cam_periph_release_locked_buses(periph); + CAM_SIM_UNLOCK(sim); if (retval == 0) goto bailout_done; @@ -3566,13 +3574,13 @@ xpt_path_counts(struct cam_path *path, u else *bus_ref = 0; } - xpt_unlock_buses(); if (periph_ref) { if (path->periph) *periph_ref = path->periph->refcount; else *periph_ref = 0; } + xpt_unlock_buses(); if (target_ref) { if (path->target) *target_ref = path->target->refcount; @@ -4447,54 +4455,55 @@ xpt_release_bus(struct cam_eb *bus) xpt_lock_buses(); KASSERT(bus->refcount >= 1, ("bus->refcount >= 1")); - if ((--bus->refcount == 0) - && (TAILQ_FIRST(&bus->et_entries) == NULL)) { - TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); - xsoftc.bus_generation++; - xpt_unlock_buses(); - cam_sim_release(bus->sim); - free(bus, M_CAMXPT); - } else + if (--bus->refcount > 0) { xpt_unlock_buses(); + return; + } + KASSERT(TAILQ_EMPTY(&bus->et_entries), + ("refcount is zero, but target list is not empty")); + TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); + xsoftc.bus_generation++; + xpt_unlock_buses(); + cam_sim_release(bus->sim); + free(bus, M_CAMXPT); } static struct cam_et * xpt_alloc_target(struct cam_eb *bus, target_id_t target_id) { - struct cam_et *target; + struct cam_et *cur_target, *target; + mtx_assert(bus->sim->mtx, MA_OWNED); target = (struct cam_et *)malloc(sizeof(*target), M_CAMXPT, M_NOWAIT|M_ZERO); - if (target != NULL) { - struct cam_et *cur_target; - - TAILQ_INIT(&target->ed_entries); - target->bus = bus; - target->target_id = target_id; - target->refcount = 1; - target->generation = 0; - target->luns = NULL; - timevalclear(&target->last_reset); - /* - * Hold a reference to our parent bus so it - * will not go away before we do. - */ - xpt_lock_buses(); - bus->refcount++; - xpt_unlock_buses(); + if (target == NULL) + return (NULL); - /* Insertion sort into our bus's target list */ - cur_target = TAILQ_FIRST(&bus->et_entries); - while (cur_target != NULL && cur_target->target_id < target_id) - cur_target = TAILQ_NEXT(cur_target, links); + TAILQ_INIT(&target->ed_entries); + target->bus = bus; + target->target_id = target_id; + target->refcount = 1; + target->generation = 0; + target->luns = NULL; + timevalclear(&target->last_reset); + /* + * Hold a reference to our parent bus so it + * will not go away before we do. + */ + xpt_lock_buses(); + bus->refcount++; + xpt_unlock_buses(); - if (cur_target != NULL) { - TAILQ_INSERT_BEFORE(cur_target, target, links); - } else { - TAILQ_INSERT_TAIL(&bus->et_entries, target, links); - } - bus->generation++; + /* Insertion sort into our bus's target list */ + cur_target = TAILQ_FIRST(&bus->et_entries); + while (cur_target != NULL && cur_target->target_id < target_id) + cur_target = TAILQ_NEXT(cur_target, links); + if (cur_target != NULL) { + TAILQ_INSERT_BEFORE(cur_target, target, links); + } else { + TAILQ_INSERT_TAIL(&bus->et_entries, target, links); } + bus->generation++; return (target); } @@ -4502,24 +4511,24 @@ static void xpt_release_target(struct cam_et *target) { - if (target->refcount == 1) { - if (TAILQ_FIRST(&target->ed_entries) == NULL) { - TAILQ_REMOVE(&target->bus->et_entries, target, links); - target->bus->generation++; - xpt_release_bus(target->bus); - if (target->luns) - free(target->luns, M_CAMXPT); - free(target, M_CAMXPT); - } - } else - target->refcount--; + mtx_assert(target->bus->sim->mtx, MA_OWNED); + if (--target->refcount > 0) + return; + KASSERT(TAILQ_EMPTY(&target->ed_entries), + ("refcount is zero, but device list is not empty")); + TAILQ_REMOVE(&target->bus->et_entries, target, links); + target->bus->generation++; + xpt_release_bus(target->bus); + if (target->luns) + free(target->luns, M_CAMXPT); + free(target, M_CAMXPT); } static struct cam_ed * xpt_alloc_device_default(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id) { - struct cam_ed *device, *cur_device; + struct cam_ed *device; device = xpt_alloc_device(bus, target, lun_id); if (device == NULL) @@ -4528,73 +4537,65 @@ xpt_alloc_device_default(struct cam_eb * device->mintags = 1; device->maxtags = 1; bus->sim->max_ccbs += device->ccbq.devq_openings; - cur_device = TAILQ_FIRST(&target->ed_entries); - while (cur_device != NULL && cur_device->lun_id < lun_id) - cur_device = TAILQ_NEXT(cur_device, links); - if (cur_device != NULL) { - TAILQ_INSERT_BEFORE(cur_device, device, links); - } else { - TAILQ_INSERT_TAIL(&target->ed_entries, device, links); - } - target->generation++; - return (device); } struct cam_ed * xpt_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id) { - struct cam_ed *device; - struct cam_devq *devq; + struct cam_ed *cur_device, *device; + struct cam_devq *devq; cam_status status; + mtx_assert(target->bus->sim->mtx, MA_OWNED); /* Make space for us in the device queue on our bus */ devq = bus->sim->devq; status = cam_devq_resize(devq, devq->alloc_queue.array_size + 1); + if (status != CAM_REQ_CMP) + return (NULL); - if (status != CAM_REQ_CMP) { - device = NULL; - } else { - device = (struct cam_ed *)malloc(sizeof(*device), - M_CAMDEV, M_NOWAIT|M_ZERO); - } - - if (device != NULL) { - cam_init_pinfo(&device->alloc_ccb_entry.pinfo); - device->alloc_ccb_entry.device = device; - cam_init_pinfo(&device->send_ccb_entry.pinfo); - device->send_ccb_entry.device = device; - device->target = target; - device->lun_id = lun_id; - device->sim = bus->sim; - /* Initialize our queues */ - if (camq_init(&device->drvq, 0) != 0) { - free(device, M_CAMDEV); - return (NULL); - } - if (cam_ccbq_init(&device->ccbq, - bus->sim->max_dev_openings) != 0) { - camq_fini(&device->drvq); - free(device, M_CAMDEV); - return (NULL); - } - SLIST_INIT(&device->asyncs); - SLIST_INIT(&device->periphs); - device->generation = 0; - device->owner = NULL; - device->flags = CAM_DEV_UNCONFIGURED; - device->tag_delay_count = 0; - device->tag_saved_openings = 0; - device->refcount = 1; - callout_init_mtx(&device->callout, bus->sim->mtx, 0); - - /* - * Hold a reference to our parent target so it - * will not go away before we do. - */ - target->refcount++; + device = (struct cam_ed *)malloc(sizeof(*device), + M_CAMDEV, M_NOWAIT|M_ZERO); + if (device == NULL) + return (NULL); + cam_init_pinfo(&device->alloc_ccb_entry.pinfo); + device->alloc_ccb_entry.device = device; + cam_init_pinfo(&device->send_ccb_entry.pinfo); + device->send_ccb_entry.device = device; + device->target = target; + device->lun_id = lun_id; + device->sim = bus->sim; + /* Initialize our queues */ + if (camq_init(&device->drvq, 0) != 0) { + free(device, M_CAMDEV); + return (NULL); + } + if (cam_ccbq_init(&device->ccbq, + bus->sim->max_dev_openings) != 0) { + camq_fini(&device->drvq); + free(device, M_CAMDEV); + return (NULL); } + SLIST_INIT(&device->asyncs); + SLIST_INIT(&device->periphs); + device->generation = 0; + device->owner = NULL; + device->flags = CAM_DEV_UNCONFIGURED; + device->tag_delay_count = 0; + device->tag_saved_openings = 0; + device->refcount = 1; + callout_init_mtx(&device->callout, bus->sim->mtx, 0); + + cur_device = TAILQ_FIRST(&target->ed_entries); + while (cur_device != NULL && cur_device->lun_id < lun_id) + cur_device = TAILQ_NEXT(cur_device, links); + if (cur_device != NULL) + TAILQ_INSERT_BEFORE(cur_device, device, links); + else + TAILQ_INSERT_TAIL(&target->ed_entries, device, links); + target->refcount++; + target->generation++; return (device); } @@ -4602,46 +4603,49 @@ void xpt_acquire_device(struct cam_ed *device) { + mtx_assert(device->sim->mtx, MA_OWNED); device->refcount++; } void xpt_release_device(struct cam_ed *device) { + struct cam_devq *devq; - if (device->refcount == 1) { - struct cam_devq *devq; + mtx_assert(device->sim->mtx, MA_OWNED); + if (--device->refcount > 0) + return; - if (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX - || device->send_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX) - panic("Removing device while still queued for ccbs"); - - if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) - callout_stop(&device->callout); - - TAILQ_REMOVE(&device->target->ed_entries, device,links); - device->target->generation++; - device->target->bus->sim->max_ccbs -= device->ccbq.devq_openings; - /* Release our slot in the devq */ - devq = device->target->bus->sim->devq; - cam_devq_resize(devq, devq->alloc_queue.array_size - 1); - camq_fini(&device->drvq); - cam_ccbq_fini(&device->ccbq); - /* - * Free allocated memory. free(9) does nothing if the - * supplied pointer is NULL, so it is safe to call without - * checking. - */ - free(device->supported_vpds, M_CAMXPT); - free(device->device_id, M_CAMXPT); - free(device->physpath, M_CAMXPT); - free(device->rcap_buf, M_CAMXPT); - free(device->serial_num, M_CAMXPT); + KASSERT(SLIST_EMPTY(&device->periphs), + ("refcount is zero, but periphs list is not empty")); + if (device->alloc_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX + || device->send_ccb_entry.pinfo.index != CAM_UNQUEUED_INDEX) + panic("Removing device while still queued for ccbs"); + + if ((device->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) + callout_stop(&device->callout); + + TAILQ_REMOVE(&device->target->ed_entries, device,links); + device->target->generation++; + device->target->bus->sim->max_ccbs -= device->ccbq.devq_openings; + /* Release our slot in the devq */ + devq = device->target->bus->sim->devq; + cam_devq_resize(devq, devq->alloc_queue.array_size - 1); + camq_fini(&device->drvq); + cam_ccbq_fini(&device->ccbq); + /* + * Free allocated memory. free(9) does nothing if the + * supplied pointer is NULL, so it is safe to call without + * checking. + */ + free(device->supported_vpds, M_CAMXPT); + free(device->device_id, M_CAMXPT); + free(device->physpath, M_CAMXPT); + free(device->rcap_buf, M_CAMXPT); + free(device->serial_num, M_CAMXPT); - xpt_release_target(device->target); - free(device, M_CAMDEV); - } else - device->refcount--; + xpt_release_target(device->target); + free(device, M_CAMDEV); } u_int32_t @@ -4689,6 +4693,7 @@ xpt_find_target(struct cam_eb *bus, targ { struct cam_et *target; + mtx_assert(bus->sim->mtx, MA_OWNED); for (target = TAILQ_FIRST(&bus->et_entries); target != NULL; target = TAILQ_NEXT(target, links)) { @@ -4705,6 +4710,7 @@ xpt_find_device(struct cam_et *target, l { struct cam_ed *device; + mtx_assert(target->bus->sim->mtx, MA_OWNED); for (device = TAILQ_FIRST(&target->ed_entries); device != NULL; device = TAILQ_NEXT(device, links)) { Modified: stable/9/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_xpt.c Thu Apr 18 10:08:27 2013 (r249616) +++ stable/9/sys/cam/scsi/scsi_xpt.c Thu Apr 18 10:40:40 2013 (r249617) @@ -2306,7 +2306,6 @@ scsi_alloc_device(struct cam_eb *bus, st struct cam_path path; struct scsi_quirk_entry *quirk; struct cam_ed *device; - struct cam_ed *cur_device; device = xpt_alloc_device(bus, target, lun_id); if (device == NULL) @@ -2335,16 +2334,6 @@ scsi_alloc_device(struct cam_eb *bus, st * do. */ bus->sim->max_ccbs += device->ccbq.devq_openings; - /* Insertion sort into our target's device list */ - cur_device = TAILQ_FIRST(&target->ed_entries); - while (cur_device != NULL && cur_device->lun_id < lun_id) - cur_device = TAILQ_NEXT(cur_device, links); - if (cur_device != NULL) { - TAILQ_INSERT_BEFORE(cur_device, device, links); - } else { - TAILQ_INSERT_TAIL(&target->ed_entries, device, links); - } - target->generation++; if (lun_id != CAM_LUN_WILDCARD) { xpt_compile_path(&path, NULL, From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:42:49 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 800DA198; Thu, 18 Apr 2013 10:42:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 727E5B61; Thu, 18 Apr 2013 10:42:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAgnBv013091; Thu, 18 Apr 2013 10:42:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAgncj013090; Thu, 18 Apr 2013 10:42:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181042.r3IAgncj013090@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249618 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:42:49 -0000 Author: mav Date: Thu Apr 18 10:42:48 2013 New Revision: 249618 URL: http://svnweb.freebsd.org/changeset/base/249618 Log: MFC r249224: Remove extra semicolons from CAM_SIM_[UN]LOCK() macros. Modified: stable/9/sys/cam/cam_sim.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_sim.h ============================================================================== --- stable/9/sys/cam/cam_sim.h Thu Apr 18 10:40:40 2013 (r249617) +++ stable/9/sys/cam/cam_sim.h Thu Apr 18 10:42:48 2013 (r249618) @@ -123,8 +123,8 @@ struct cam_sim { }; -#define CAM_SIM_LOCK(sim) mtx_lock((sim)->mtx); -#define CAM_SIM_UNLOCK(sim) mtx_unlock((sim)->mtx); +#define CAM_SIM_LOCK(sim) mtx_lock((sim)->mtx) +#define CAM_SIM_UNLOCK(sim) mtx_unlock((sim)->mtx) static __inline u_int32_t cam_sim_path(struct cam_sim *sim) From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:49:53 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 520A88ED; Thu, 18 Apr 2013 10:49:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 44338F38; Thu, 18 Apr 2013 10:49:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAnrTj014295; Thu, 18 Apr 2013 10:49:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAnqxg014292; Thu, 18 Apr 2013 10:49:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181049.r3IAnqxg014292@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249619 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:49:53 -0000 Author: mav Date: Thu Apr 18 10:49:52 2013 New Revision: 249619 URL: http://svnweb.freebsd.org/changeset/base/249619 Log: MFC r248674: Make g_wither_washer() to not loop by itself, but only when there was some more topology change done that may require its attention. Add few missing g_do_wither() calls in respective places to signal it. This fixes potential infinite loop here when some provider is withered, but still opened or connected for some reason and so can not be destroyed. For example, see r227009 and r227510. Modified: stable/9/sys/geom/geom_event.c stable/9/sys/geom/geom_int.h stable/9/sys/geom/geom_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_event.c ============================================================================== --- stable/9/sys/geom/geom_event.c Thu Apr 18 10:42:48 2013 (r249618) +++ stable/9/sys/geom/geom_event.c Thu Apr 18 10:49:52 2013 (r249619) @@ -273,21 +273,16 @@ one_event(void) void g_run_events() { - int i; for (;;) { g_topology_lock(); while (one_event()) ; mtx_assert(&g_eventlock, MA_OWNED); - i = g_wither_work; - if (i) { + if (g_wither_work) { + g_wither_work = 0; mtx_unlock(&g_eventlock); - while (i) { - i = g_wither_washer(); - g_wither_work = i & 1; - i &= 2; - } + g_wither_washer(); g_topology_unlock(); } else { g_topology_unlock(); Modified: stable/9/sys/geom/geom_int.h ============================================================================== --- stable/9/sys/geom/geom_int.h Thu Apr 18 10:42:48 2013 (r249618) +++ stable/9/sys/geom/geom_int.h Thu Apr 18 10:49:52 2013 (r249619) @@ -65,7 +65,7 @@ void g_do_wither(void); /* geom_subr.c */ extern struct class_list_head g_classes; extern char *g_wait_event, *g_wait_sim, *g_wait_up, *g_wait_down; -int g_wither_washer(void); +void g_wither_washer(void); /* geom_io.c */ void g_io_init(void); Modified: stable/9/sys/geom/geom_subr.c ============================================================================== --- stable/9/sys/geom/geom_subr.c Thu Apr 18 10:42:48 2013 (r249618) +++ stable/9/sys/geom/geom_subr.c Thu Apr 18 10:49:52 2013 (r249619) @@ -434,20 +434,16 @@ g_wither_geom_close(struct g_geom *gp, i /* * This function is called (repeatedly) until we cant wash away more - * withered bits at present. Return value contains two bits. Bit 0 - * set means "withering stuff we can't wash now", bit 1 means "call - * me again, there may be stuff I didn't get the first time around. + * withered bits at present. */ -int +void g_wither_washer() { struct g_class *mp; struct g_geom *gp, *gp2; struct g_provider *pp, *pp2; struct g_consumer *cp, *cp2; - int result; - result = 0; g_topology_assert(); LIST_FOREACH(mp, &g_classes, class) { LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { @@ -456,35 +452,25 @@ g_wither_washer() continue; if (LIST_EMPTY(&pp->consumers)) g_destroy_provider(pp); - else - result |= 1; } if (!(gp->flags & G_GEOM_WITHER)) continue; LIST_FOREACH_SAFE(pp, &gp->provider, provider, pp2) { if (LIST_EMPTY(&pp->consumers)) g_destroy_provider(pp); - else - result |= 1; } LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp2) { - if (cp->acr || cp->acw || cp->ace) { - result |= 1; + if (cp->acr || cp->acw || cp->ace) continue; - } if (cp->provider != NULL) g_detach(cp); g_destroy_consumer(cp); - result |= 2; } if (LIST_EMPTY(&gp->provider) && LIST_EMPTY(&gp->consumer)) g_destroy_geom(gp); - else - result |= 1; } } - return (result); } struct g_consumer * @@ -772,9 +758,9 @@ g_detach(struct g_consumer *cp) pp = cp->provider; LIST_REMOVE(cp, consumers); cp->provider = NULL; - if (pp->geom->flags & G_GEOM_WITHER) - g_do_wither(); - else if (pp->flags & G_PF_WITHER) + if ((cp->geom->flags & G_GEOM_WITHER) || + (pp->geom->flags & G_GEOM_WITHER) || + (pp->flags & G_PF_WITHER)) g_do_wither(); redo_rank(cp->geom); } @@ -873,6 +859,9 @@ g_access(struct g_consumer *cp, int dcr, if (pp->acr != 0 || pp->acw != 0 || pp->ace != 0) KASSERT(pp->sectorsize > 0, ("Provider %s lacks sectorsize", pp->name)); + if ((cp->geom->flags & G_GEOM_WITHER) && + cp->acr == 0 && cp->acw == 0 && cp->ace == 0) + g_do_wither(); } return (error); } From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 10:57:57 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71DCFC09; Thu, 18 Apr 2013 10:57:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54345F8E; Thu, 18 Apr 2013 10:57:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IAvveP017118; Thu, 18 Apr 2013 10:57:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IAvvTP017117; Thu, 18 Apr 2013 10:57:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181057.r3IAvvTP017117@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 10:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249620 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 10:57:57 -0000 Author: mav Date: Thu Apr 18 10:57:56 2013 New Revision: 249620 URL: http://svnweb.freebsd.org/changeset/base/249620 Log: MFC r238171, r248679: Fix long known deadlock between geom dev destruction and d_close() call. Use destroy_dev_sched_cb() to not wait for device destruction while holding GEOM topology lock (that actually caused deadlock). Use request counting protected by mutex to properly wait for outstanding requests completion in cases of device closing and geom destruction. Unlike r227009, this code does not block taskqueue thread for indefinite time, waiting for completion. Modified: stable/9/sys/geom/geom_dev.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/geom_dev.c ============================================================================== --- stable/9/sys/geom/geom_dev.c Thu Apr 18 10:49:52 2013 (r249619) +++ stable/9/sys/geom/geom_dev.c Thu Apr 18 10:57:56 2013 (r249620) @@ -56,10 +56,13 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * Use the consumer private field to reference a physdev alias (if any). - */ -#define cp_alias_dev private +struct g_dev_softc { + struct mtx sc_mtx; + struct cdev *sc_dev; + struct cdev *sc_alias; + int sc_open; + int sc_active; +}; static d_open_t g_dev_open; static d_close_t g_dev_close; @@ -90,6 +93,27 @@ static struct g_class g_dev_class = { .attrchanged = g_dev_attrchanged }; +static void +g_dev_destroy(void *arg, int flags __unused) +{ + struct g_consumer *cp; + struct g_geom *gp; + struct g_dev_softc *sc; + + g_topology_assert(); + cp = arg; + gp = cp->geom; + sc = cp->private; + g_trace(G_T_TOPOLOGY, "g_dev_destroy(%p(%s))", cp, gp->name); + if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) + g_access(cp, -cp->acr, -cp->acw, -cp->ace); + g_detach(cp); + g_destroy_consumer(cp); + g_destroy_geom(gp); + mtx_destroy(&sc->sc_mtx); + g_free(sc); +} + void g_dev_print(void) { @@ -106,14 +130,16 @@ g_dev_print(void) static void g_dev_attrchanged(struct g_consumer *cp, const char *attr) { + struct g_dev_softc *sc; struct cdev *dev; char buf[SPECNAMELEN + 6]; + sc = cp->private; if (strcmp(attr, "GEOM::media") == 0) { - dev = cp->geom->softc; + dev = sc->sc_dev; snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); - dev = cp->cp_alias_dev; + dev = sc->sc_alias; if (dev != NULL) { snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, @@ -138,14 +164,14 @@ g_dev_attrchanged(struct g_consumer *cp, struct cdev *old_alias_dev; struct cdev **alias_devp; - dev = cp->geom->softc; - old_alias_dev = cp->cp_alias_dev; - alias_devp = (struct cdev **)&cp->cp_alias_dev; + dev = sc->sc_dev; + old_alias_dev = sc->sc_alias; + alias_devp = (struct cdev **)&sc->sc_alias; make_dev_physpath_alias(MAKEDEV_WAITOK, alias_devp, dev, old_alias_dev, physpath); - } else if (cp->cp_alias_dev) { - destroy_dev((struct cdev *)cp->cp_alias_dev); - cp->cp_alias_dev = NULL; + } else if (sc->sc_alias) { + destroy_dev((struct cdev *)sc->sc_alias); + sc->sc_alias = NULL; } g_free(physpath); } @@ -170,6 +196,7 @@ g_dev_taste(struct g_class *mp, struct g { struct g_geom *gp; struct g_consumer *cp; + struct g_dev_softc *sc; int error, len; struct cdev *dev, *adev; char buf[64], *val; @@ -177,7 +204,10 @@ g_dev_taste(struct g_class *mp, struct g g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); gp = g_new_geomf(mp, "%s", pp->name); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->sc_mtx, "g_dev", NULL, MTX_DEF); cp = g_new_consumer(gp); + cp->private = sc; error = g_attach(cp, pp); KASSERT(error == 0, ("g_dev_taste(%s) failed to g_attach, err=%d", pp->name, error)); @@ -189,8 +219,11 @@ g_dev_taste(struct g_class *mp, struct g g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); + mtx_destroy(&sc->sc_mtx); + g_free(sc); return (NULL); } + sc->sc_dev = dev; /* Search for device alias name and create it if found. */ adev = NULL; @@ -211,14 +244,11 @@ g_dev_taste(struct g_class *mp, struct g if (pp->flags & G_PF_CANDELETE) dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; - gp->softc = dev; - dev->si_drv1 = gp; dev->si_drv2 = cp; if (adev != NULL) { if (pp->flags & G_PF_CANDELETE) adev->si_flags |= SI_CANDELETE; adev->si_iosize_max = MAXPHYS; - adev->si_drv1 = gp; adev->si_drv2 = cp; } @@ -230,17 +260,15 @@ g_dev_taste(struct g_class *mp, struct g static int g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td) { - struct g_geom *gp; struct g_consumer *cp; + struct g_dev_softc *sc; int error, r, w, e; - gp = dev->si_drv1; cp = dev->si_drv2; - if (gp == NULL || cp == NULL || gp->softc != dev) + if (cp == NULL) return(ENXIO); /* g_dev_taste() not done yet */ - g_trace(G_T_ACCESS, "g_dev_open(%s, %d, %d, %p)", - gp->name, flags, fmt, td); + cp->geom->name, flags, fmt, td); r = flags & FREAD ? 1 : 0; w = flags & FWRITE ? 1 : 0; @@ -259,27 +287,32 @@ g_dev_open(struct cdev *dev, int flags, return (error); } g_topology_lock(); - if (dev->si_devsw == NULL) - error = ENXIO; /* We were orphaned */ - else - error = g_access(cp, r, w, e); + error = g_access(cp, r, w, e); g_topology_unlock(); + if (error == 0) { + sc = cp->private; + mtx_lock(&sc->sc_mtx); + if (sc->sc_open == 0 && sc->sc_active != 0) + wakeup(&sc->sc_active); + sc->sc_open += r + w + e; + mtx_unlock(&sc->sc_mtx); + } return(error); } static int g_dev_close(struct cdev *dev, int flags, int fmt, struct thread *td) { - struct g_geom *gp; struct g_consumer *cp; - int error, r, w, e, i; + struct g_dev_softc *sc; + int error, r, w, e; - gp = dev->si_drv1; cp = dev->si_drv2; - if (gp == NULL || cp == NULL) + if (cp == NULL) return(ENXIO); g_trace(G_T_ACCESS, "g_dev_close(%s, %d, %d, %p)", - gp->name, flags, fmt, td); + cp->geom->name, flags, fmt, td); + r = flags & FREAD ? -1 : 0; w = flags & FWRITE ? -1 : 0; #ifdef notyet @@ -287,25 +320,14 @@ g_dev_close(struct cdev *dev, int flags, #else e = 0; #endif + sc = cp->private; + mtx_lock(&sc->sc_mtx); + sc->sc_open += r + w + e; + while (sc->sc_open == 0 && sc->sc_active != 0) + msleep(&sc->sc_active, &sc->sc_mtx, 0, "PRIBIO", 0); + mtx_unlock(&sc->sc_mtx); g_topology_lock(); - if (dev->si_devsw == NULL) - error = ENXIO; /* We were orphaned */ - else - error = g_access(cp, r, w, e); - for (i = 0; i < 10 * hz;) { - if (cp->acr != 0 || cp->acw != 0) - break; - if (cp->nstart == cp->nend) - break; - pause("gdevwclose", hz / 10); - i += hz / 10; - } - if (cp->acr == 0 && cp->acw == 0 && cp->nstart != cp->nend) { - printf("WARNING: Final close of geom_dev(%s) %s %s\n", - gp->name, - "still has outstanding I/O after 10 seconds.", - "Completing close anyway, panic may happen later."); - } + error = g_access(cp, r, w, e); g_topology_unlock(); return (error); } @@ -319,7 +341,6 @@ g_dev_close(struct cdev *dev, int flags, static int g_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { - struct g_geom *gp; struct g_consumer *cp; struct g_provider *pp; struct g_kerneldump kd; @@ -327,7 +348,6 @@ g_dev_ioctl(struct cdev *dev, u_long cmd int i, error; u_int u; - gp = dev->si_drv1; cp = dev->si_drv2; pp = cp->provider; @@ -441,8 +461,13 @@ g_dev_ioctl(struct cdev *dev, u_long cmd static void g_dev_done(struct bio *bp2) { + struct g_consumer *cp; + struct g_dev_softc *sc; struct bio *bp; + int destroy; + cp = bp2->bio_from; + sc = cp->private; bp = bp2->bio_parent; bp->bio_error = bp2->bio_error; if (bp->bio_error != 0) { @@ -456,6 +481,17 @@ g_dev_done(struct bio *bp2) bp->bio_resid = bp->bio_length - bp2->bio_completed; bp->bio_completed = bp2->bio_completed; g_destroy_bio(bp2); + destroy = 0; + mtx_lock(&sc->sc_mtx); + if ((--sc->sc_active) == 0) { + if (sc->sc_open == 0) + wakeup(&sc->sc_active); + if (sc->sc_dev == NULL) + destroy = 1; + } + mtx_unlock(&sc->sc_mtx); + if (destroy) + g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); biodone(bp); } @@ -465,6 +501,7 @@ g_dev_strategy(struct bio *bp) struct g_consumer *cp; struct bio *bp2; struct cdev *dev; + struct g_dev_softc *sc; KASSERT(bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE || @@ -472,6 +509,7 @@ g_dev_strategy(struct bio *bp) ("Wrong bio_cmd bio=%p cmd=%d", bp, bp->bio_cmd)); dev = bp->bio_dev; cp = dev->si_drv2; + sc = cp->private; KASSERT(cp->acr || cp->acw, ("Consumer with zero access count in g_dev_strategy")); #ifdef INVARIANTS @@ -482,6 +520,11 @@ g_dev_strategy(struct bio *bp) return; } #endif + mtx_lock(&sc->sc_mtx); + KASSERT(sc->sc_open > 0, ("Closed device in g_dev_strategy")); + sc->sc_active++; + mtx_unlock(&sc->sc_mtx); + for (;;) { /* * XXX: This is not an ideal solution, but I belive it to @@ -505,46 +548,61 @@ g_dev_strategy(struct bio *bp) } /* + * g_dev_callback() + * + * Called by devfs when asynchronous device destruction is completed. + * - Mark that we have no attached device any more. + * - If there are no outstanding requests, schedule geom destruction. + * Otherwise destruction will be scheduled later by g_dev_done(). + */ + +static void +g_dev_callback(void *arg) +{ + struct g_consumer *cp; + struct g_dev_softc *sc; + int destroy; + + cp = arg; + sc = cp->private; + g_trace(G_T_TOPOLOGY, "g_dev_callback(%p(%s))", cp, cp->geom->name); + + mtx_lock(&sc->sc_mtx); + sc->sc_dev = NULL; + sc->sc_alias = NULL; + destroy = (sc->sc_active == 0); + mtx_unlock(&sc->sc_mtx); + if (destroy) + g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); +} + +/* * g_dev_orphan() * * Called from below when the provider orphaned us. * - Clear any dump settings. - * - Destroy the struct cdev *to prevent any more request from coming in. The - * provider is already marked with an error, so anything which comes in - * in the interrim will be returned immediately. - * - Wait for any outstanding I/O to finish. - * - Set our access counts to zero, whatever they were. - * - Detach and self-destruct. + * - Request asynchronous device destruction to prevent any more requests + * from coming in. The provider is already marked with an error, so + * anything which comes in in the interrim will be returned immediately. */ static void g_dev_orphan(struct g_consumer *cp) { - struct g_geom *gp; struct cdev *dev; + struct g_dev_softc *sc; g_topology_assert(); - gp = cp->geom; - dev = gp->softc; - g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, gp->name); + sc = cp->private; + dev = sc->sc_dev; + g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, cp->geom->name); /* Reset any dump-area set on this device */ if (dev->si_flags & SI_DUMPDEV) set_dumper(NULL); /* Destroy the struct cdev *so we get no more requests */ - destroy_dev(dev); - - /* Wait for the cows to come home */ - while (cp->nstart != cp->nend) - pause("gdevorphan", hz / 10); - - if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) - g_access(cp, -cp->acr, -cp->acw, -cp->ace); - - g_detach(cp); - g_destroy_consumer(cp); - g_destroy_geom(gp); + destroy_dev_sched_cb(dev, g_dev_callback, cp); } DECLARE_GEOM_CLASS(g_dev_class, g_dev); From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 11:13:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E51C9F5E; Thu, 18 Apr 2013 11:13:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C80219F; Thu, 18 Apr 2013 11:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IBDmT9023318; Thu, 18 Apr 2013 11:13:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IBDm11023317; Thu, 18 Apr 2013 11:13:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181113.r3IBDm11023317@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 11:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249621 - stable/9/sys/geom X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 11:13:49 -0000 Author: mav Date: Thu Apr 18 11:13:48 2013 New Revision: 249621 URL: http://svnweb.freebsd.org/changeset/base/249621 Log: MFC r248694: In GEOM DISK: - Replace single done mutex with per-disk ones. On system with several disks on several HBAs that removes small, but measurable lock congestion. - Modify disk destruction process to not destroy the mutex prematurely. - Remove some extra pointer derefences. Modified: stable/9/sys/geom/geom_disk.c Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Thu Apr 18 10:57:56 2013 (r249620) +++ stable/9/sys/geom/geom_disk.c Thu Apr 18 11:13:48 2013 (r249621) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include struct g_disk_softc { + struct mtx done_mtx; struct disk *dp; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -67,11 +68,7 @@ struct g_disk_softc { uint32_t state; }; -static struct mtx g_disk_done_mtx; - static g_access_t g_disk_access; -static g_init_t g_disk_init; -static g_fini_t g_disk_fini; static g_start_t g_disk_start; static g_ioctl_t g_disk_ioctl; static g_dumpconf_t g_disk_dumpconf; @@ -80,8 +77,6 @@ static g_provgone_t g_disk_providergone; static struct g_class g_disk_class = { .name = "DISK", .version = G_VERSION, - .init = g_disk_init, - .fini = g_disk_fini, .start = g_disk_start, .access = g_disk_access, .ioctl = g_disk_ioctl, @@ -93,20 +88,6 @@ SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, disk, CTLFLAG_RW, 0, "GEOM_DISK stuff"); -static void -g_disk_init(struct g_class *mp __unused) -{ - - mtx_init(&g_disk_done_mtx, "g_disk_done", NULL, MTX_DEF); -} - -static void -g_disk_fini(struct g_class *mp __unused) -{ - - mtx_destroy(&g_disk_done_mtx); -} - DECLARE_GEOM_CLASS(g_disk_class, g_disk); static void __inline @@ -135,7 +116,7 @@ g_disk_access(struct g_provider *pp, int g_trace(G_T_ACCESS, "g_disk_access(%s, %d, %d, %d)", pp->name, r, w, e); g_topology_assert(); - sc = pp->geom->softc; + sc = pp->private; if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { /* * Allow decreasing access count even if disk is not @@ -244,42 +225,36 @@ static void g_disk_done(struct bio *bp) { struct bio *bp2; - struct disk *dp; struct g_disk_softc *sc; /* See "notes" for why we need a mutex here */ /* XXX: will witness accept a mix of Giant/unGiant drivers here ? */ - mtx_lock(&g_disk_done_mtx); - bp->bio_completed = bp->bio_length - bp->bio_resid; - bp2 = bp->bio_parent; + sc = bp2->bio_to->private; + bp->bio_completed = bp->bio_length - bp->bio_resid; + mtx_lock(&sc->done_mtx); if (bp2->bio_error == 0) bp2->bio_error = bp->bio_error; bp2->bio_completed += bp->bio_completed; - if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0 && - (sc = bp2->bio_to->geom->softc) != NULL && - (dp = sc->dp) != NULL) { - devstat_end_transaction_bio(dp->d_devstat, bp); - } + if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0) + devstat_end_transaction_bio(sc->dp->d_devstat, bp); g_destroy_bio(bp); bp2->bio_inbed++; if (bp2->bio_children == bp2->bio_inbed) { bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed; g_io_deliver(bp2, bp2->bio_error); } - mtx_unlock(&g_disk_done_mtx); + mtx_unlock(&sc->done_mtx); } static int g_disk_ioctl(struct g_provider *pp, u_long cmd, void * data, int fflag, struct thread *td) { - struct g_geom *gp; struct disk *dp; struct g_disk_softc *sc; int error; - gp = pp->geom; - sc = gp->softc; + sc = pp->private; dp = sc->dp; if (dp->d_ioctl == NULL) @@ -299,7 +274,7 @@ g_disk_start(struct bio *bp) int error; off_t off; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { g_io_deliver(bp, ENXIO); return; @@ -458,6 +433,7 @@ g_disk_create(void *arg, int flag) g_topology_assert(); dp = arg; sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); + mtx_init(&sc->done_mtx, "g_disk_done", NULL, MTX_DEF); sc->dp = dp; gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit); gp->softc = sc; @@ -501,15 +477,7 @@ g_disk_providergone(struct g_provider *p struct disk *dp; struct g_disk_softc *sc; - sc = (struct g_disk_softc *)pp->geom->softc; - - /* - * If the softc is already NULL, then we've probably been through - * g_disk_destroy already; there is nothing for us to do anyway. - */ - if (sc == NULL) - return; - + sc = (struct g_disk_softc *)pp->private; dp = sc->dp; /* @@ -519,8 +487,21 @@ g_disk_providergone(struct g_provider *p * in g_disk_create for VERSION_01 and avoid touching the d_gone * field for old consumers. */ - if (!(dp->d_flags & DISKFLAG_LACKS_GONE) && dp->d_gone != NULL) + if (dp != NULL && (dp->d_flags & DISKFLAG_LACKS_GONE) == 0 && + dp->d_gone != NULL) dp->d_gone(dp); + if (sc->sysctl_tree != NULL) { + sysctl_ctx_free(&sc->sysctl_ctx); + sc->sysctl_tree = NULL; + } + if (sc->led[0] != 0) { + led_set(sc->led, "0"); + sc->led[0] = 0; + } + pp->private = NULL; + pp->geom->softc = NULL; + mtx_destroy(&sc->done_mtx); + g_free(sc); } static void @@ -535,16 +516,9 @@ g_disk_destroy(void *ptr, int flag) gp = dp->d_geom; if (gp != NULL) { sc = gp->softc; - if (sc->sysctl_tree != NULL) { - sysctl_ctx_free(&sc->sysctl_ctx); - sc->sysctl_tree = NULL; - } - if (sc->led[0] != 0) { - led_set(sc->led, "0"); - sc->led[0] = 0; - } - g_free(sc); - gp->softc = NULL; + if (sc != NULL) + sc->dp = NULL; + dp->d_geom = NULL; g_wither_geom(gp, ENXIO); } g_free(dp); From owner-svn-src-stable-9@FreeBSD.ORG Thu Apr 18 13:19:41 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 947EEC01; Thu, 18 Apr 2013 13:19:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85D75D88; Thu, 18 Apr 2013 13:19:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3IDJf9P061420; Thu, 18 Apr 2013 13:19:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3IDJfts061419; Thu, 18 Apr 2013 13:19:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201304181319.r3IDJfts061419@svn.freebsd.org> From: Alexander Motin Date: Thu, 18 Apr 2013 13:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249624 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Apr 2013 13:19:41 -0000 Author: mav Date: Thu Apr 18 13:19:41 2013 New Revision: 249624 URL: http://svnweb.freebsd.org/changeset/base/249624 Log: MFC r249336: Add ID for ASMedia ASM1042 USB 3.0 controller. Modified: stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Thu Apr 18 13:09:04 2013 (r249623) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Thu Apr 18 13:19:41 2013 (r249624) @@ -99,6 +99,9 @@ xhci_pci_match(device_t self) case 0x01941033: return ("NEC uPD720200 USB 3.0 controller"); + case 0x10421b21: + return ("ASMedia ASM1042 USB 3.0 controller"); + case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); case 0x8c318086: From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 19 00:47:19 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 901C3581 for ; Fri, 19 Apr 2013 00:47:19 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:16]) by mx1.freebsd.org (Postfix) with ESMTP id 72A8CDE7 for ; Fri, 19 Apr 2013 00:47:19 +0000 (UTC) Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta01.emeryville.ca.mail.comcast.net with comcast id Rcld1l0080S2fkCA1cnK4G; Fri, 19 Apr 2013 00:47:19 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta09.emeryville.ca.mail.comcast.net with comcast id RcnJ1l00J1t3BNj8VcnJev; Fri, 19 Apr 2013 00:47:18 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 35FBF73A33; Thu, 18 Apr 2013 17:47:18 -0700 (PDT) Date: Thu, 18 Apr 2013 17:47:18 -0700 From: Jeremy Chadwick To: Brooks Davis Subject: Re: svn commit: r249549 - in stable/9/sys: amd64/conf i386/conf Message-ID: <20130419004718.GA40897@icarus.home.lan> References: <201304161609.r3GG9SID009937@svn.freebsd.org> <20130416161919.GA80626@icarus.home.lan> <20130417125433.GC30222@caravan.chchile.org> <20130417193538.GB9331@icarus.home.lan> <20130417194706.GA30583@lor.one-eyed-alien.net> <20130417225603.GA13720@icarus.home.lan> <20130418022102.GB31612@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130418022102.GB31612@lor.one-eyed-alien.net> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1366332439; bh=vvZYee3haJkv/dBfhSULzfRkjrLbC/oASS4Wi7Ned2s=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=X4Qaf/5r79/Q3XHZRYL1b0QJwhbykWOw857yua+T62FevAoW8HFIS7W9vJB9XW4gZ ZQeTJJNhx5eiE/vRob4B/Pp8SHdlF6jlwHF7tCrw+Udjs1Sf3mauRvceONVNTMWlUy KYg+tLHJhQPfMSDy1R49122XynAKCyZ9SicA9VCac83ocZ6urrnnB6ukPam7523l3j YXDMlZaQuF3zvHi69KT7UnlojSOXQQNo2gG7wLl6+cah/KwcEkJEJnMGQO1yJD1YEo 1QSrpRLyY26EgZ7IARwcLPAkKwuPhBmIIjn2im07/P0iGcvMQHnE+MCOZmkWrb1mTM 6rPW/vt2/T8lA== Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 00:47:19 -0000 On Wed, Apr 17, 2013 at 09:21:02PM -0500, Brooks Davis wrote: > On Wed, Apr 17, 2013 at 03:56:03PM -0700, Jeremy Chadwick wrote: > > On Wed, Apr 17, 2013 at 02:47:06PM -0500, Brooks Davis wrote: > > > On Wed, Apr 17, 2013 at 12:35:38PM -0700, Jeremy Chadwick wrote: > > > > On Wed, Apr 17, 2013 at 02:54:33PM +0200, Jeremie Le Hen wrote: > > > > > Hi Jeremy, > > > > > > > > > > On Tue, Apr 16, 2013 at 09:19:19AM -0700, Jeremy Chadwick wrote: > > > > > > > > > > > > Now that this has been enabled by default, I should warn folks of a > > > > > > caveat that I found in the buildworld/buildkernel framework. It's > > > > > > easiest to explain like this: > > > > > > > > > > > > 1. Install FreeBSD 9.x, svn checkout of stable/9, etc... > > > > > > 2. Add WITHOUT_CDDL=true to /etc/src.conf > > > > > > 3. Rebuild + install kernel/world per src/Makefile procedure > > > > > > 4. Remove WITHOUT_CDDL=true from /etc/src.conf > > > > > > 5. rm -fr /usr/obj/* > > > > > > 6. Rebuild world > > > > > > 7. Rebuild kernel -- fails, stating "ctfconvert: not found". > > > > > > > > > > > > For whatever reason the buildkernel bits make the assumption that > > > > > > ctfconvert exists on the system (presumably in $PATH or possibly a > > > > > > hard-coded), when ideally it should try to use the recently-built > > > > > > version in /usr/obj first. > > > > > > > > > > I've tested this is a freshly installed 9.1-RELEASE jail and I haven't > > > > > been biten by the bug you describe. > > > > > > > > > > ctfconvert(1) seems to be installed by default in 9.1-RELEASE, this is > > > > > probably there problem didn't occur. I can easily verify this in the > > > > > jail: > > > > > > > > > > % root@test9:/usr/src # ls -l /usr/bin/ctfconvert /usr/bin/vi /usr/bin/tail > > > > > % -r-xr-xr-x 1 root wheel 371536 Dec 4 09:33 /usr/bin/ctfconvert > > > > > % -r-xr-xr-x 1 root wheel 19848 Apr 17 06:28 /usr/bin/tail > > > > > % -r-xr-xr-x 6 root wheel 346432 Apr 17 06:28 /usr/bin/vi > > > > > > > > > > > > > > > Do you have a theory about why you've got the problem while I haven't? > > > > > FYI, it seems 9.0-RELEASE also has ctfconvert(1): > > > > > http://svnweb.freebsd.org/base/release/9.0.0/cddl/usr.bin/ctfconvert/ > > > > > > > > > > My guess is tha this might happen if you don't have /usr/bin/ctfconvert. > > > > > I've just removed it and trying to build kernel again. > > > > > > > > I will spend some time to figure out exactly how to reproduce this. > > > > > > > > Going from recent memory (~2 weeks ago), I encountered it on my VPS box > > > > (which does run ntpd, just FYI): > > > > > > > > 1. Initially installed with 9.1-RELEASE, > > > > 2. Upgraded to stable/9 (using svn), > > > > 3. WITHOUT_CDDL=true and WITHOUT_ZFS=true added to /etc/src.conf > > > > 4. world/kernel rebuilt/reinstalled/etc. (this includes make delete-old, > > > > as per instructions in src/Makefile -- which would delete > > > > /usr/bin/ctfconvert) > > > > 5. Fast forward many months > > > > 6. Removed WITHOUT_CDDL=true from src.conf > > > > 7. Encountered the above issue ("ctfconvert: not found") during > > > > buildkernel > > > > 8. Rebuilt kernel again -- same error > > > > 9. Removed WITHOUT_ZFS=true from src.conf > > > > 10. Rebuilt kernel again -- worked > > > > > > > > This could mean WITHOUT_ZFS=true has some bearing on this situation, but > > > > I don't see how/why, as WITHOUT_CDDL is supposed to be the "trigger" for > > > > ctf* utilities. I did poke around the Makefiles and framework a bit > > > > but didn't have any epiphanies. > > > > > > > > Like I said -- I'll try to reproduce the exact scenario. > > > > > > Looking at Makefile.inc1 around line 1164 (on HEAD), ctfconvert and > > > cftmerge are bootstrap tools only when they don't exist at all on the > > > host. The code there should be expanded to bootstrap for cases where > > > the installed ones are known to be broken (virtually all prior versions > > > given recent fixes) as well as when they aren't present on the host > > > system. > > > > I'm able to reproduce the issue I speak of with 100% reliability. > > Jeremie, I'm not sure why you're not able to reproduce this, because I > > can do so reliably/consistently. > > The following patch will probably fix the problem. > > Index: Makefile.inc1 > =================================================================== > --- Makefile.inc1 (revision 249590) > +++ Makefile.inc1 (working copy) > @@ -1114,9 +1114,7 @@ > usr.bin/clang/clang-tblgen > .endif > > -.if ${MK_CDDL} != "no" && \ > - ${BOOTSTRAPPING} < 800038 && \ > - !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999) > +.if ${MK_CDDL} != "no" > _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ > lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge > .endif > > This patch unconditionally bootstraps ctfconvert and ctfmerge unless > WITHOUT_CDDL is set. The above patch now breaks buildworld (not buildkernel) when WITHOUT_CDDL=true **is not** defined: cc -O2 -pipe -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/compat/opensolaris -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/compat/opensolaris/include -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/head -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/common -I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt -I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris/uts/common -DNEED_SOLARIS_BOOLEAN -g -std=gnu89 -Wno-unknown-pragmas -I/usr/obj/usr/src/tmp/legacy/usr/include -c /usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/cvt/util.c make: don't know how to make /usr/lib/libctf.a. Stop *** [bootstrap-tools] Error code 2 Stop in /usr/src. *** [_bootstrap-tools] Error code 1 Stop in /usr/src. *** [buildworld] Error code 1 Stop in /usr/src. By the way, the lines relevant to the _dtrace_tools assignment contain spaces, not tabs, which is generally considered bad. Fixing this doesn't fix the above buildworld failure. -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB | From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 19 03:55:55 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71F9959F; Fri, 19 Apr 2013 03:55:55 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4867378A; Fri, 19 Apr 2013 03:55:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J3tsPJ035800; Fri, 19 Apr 2013 03:55:54 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J3tsMb035799; Fri, 19 Apr 2013 03:55:54 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304190355.r3J3tsMb035799@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 19 Apr 2013 03:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249632 - stable/9/usr.bin/ctlstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 03:55:55 -0000 Author: ken Date: Fri Apr 19 03:55:54 2013 New Revision: 249632 URL: http://svnweb.freebsd.org/changeset/base/249632 Log: MFC r249334 and r249384: ------------------------------------------------------------------------ r249334 | ken | 2013-04-10 10:01:45 -0600 (Wed, 10 Apr 2013) | 11 lines Fix a time calculation error in ctlstat_standard(). ctlstat.c: When converting a timeval to a floating point number in ctlstat_standard(), cast the nanoseconds calculation to a long double, so we don't lose precision. Without the cast, we wind up with a time in whole seconds only. Sponsored by: Spectra Logic ------------------------------------------------------------------------ r249384 | ken | 2013-04-11 15:18:04 -0600 (Thu, 11 Apr 2013) | 17 lines Fix bugs in the elapsed time calculation in ctlstat_standard() pointed out by bde: - Casting to long double isn't needed. - The division isn't needed, multiplication can be used. "When 1 nanosecond is in a floating point literal, the whole expression is automatically promoted correctly." - non-KNF indentation (1 tab) for the newly split line - different non-KNF indentation (5 spaces) for the previously split line - exessive parentheses around the division operation - bogus blank line which splits up the etime initialization - general verboseness from the above. Submitted by: bde Sponsored by: Spectra Logic Modified: stable/9/usr.bin/ctlstat/ctlstat.c Directory Properties: stable/9/usr.bin/ctlstat/ (props changed) Modified: stable/9/usr.bin/ctlstat/ctlstat.c ============================================================================== --- stable/9/usr.bin/ctlstat/ctlstat.c Fri Apr 19 00:30:52 2013 (r249631) +++ stable/9/usr.bin/ctlstat/ctlstat.c Fri Apr 19 03:55:54 2013 (r249632) @@ -404,7 +404,7 @@ ctlstat_json(struct ctlstat_context *ctx static void ctlstat_standard(struct ctlstat_context *ctx) { - long double cur_secs, prev_secs, etime; + long double etime; uint64_t delta_jiffies, delta_idle; uint32_t port; long double cpu_percentage; @@ -416,11 +416,8 @@ ctlstat_standard(struct ctlstat_context if (F_CPU(ctx) && (getcpu(&ctx->cur_cpu) != 0)) errx(1, "error returned from getcpu()"); - cur_secs = ctx->cur_time.tv_sec + (ctx->cur_time.tv_nsec / 1000000000); - prev_secs = ctx->prev_time.tv_sec + - (ctx->prev_time.tv_nsec / 1000000000); - - etime = cur_secs - prev_secs; + etime = ctx->cur_time.tv_sec - ctx->prev_time.tv_sec + + (ctx->prev_time.tv_nsec - ctx->cur_time.tv_nsec) * 1e-9; if (F_CPU(ctx)) { ctx->prev_total_jiffies = ctx->cur_total_jiffies; From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 19 05:28:08 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C917FF7B; Fri, 19 Apr 2013 05:28:08 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB51793D; Fri, 19 Apr 2013 05:28:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J5S8K6064248; Fri, 19 Apr 2013 05:28:08 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J5S8Sa064247; Fri, 19 Apr 2013 05:28:08 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201304190528.r3J5S8Sa064247@svn.freebsd.org> From: Sean Bruno Date: Fri, 19 Apr 2013 05:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249635 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 05:28:08 -0000 Author: sbruno Date: Fri Apr 19 05:28:08 2013 New Revision: 249635 URL: http://svnweb.freebsd.org/changeset/base/249635 Log: MFC r249170 Notify CAM on state* change to a logical volume not status. This resolves the issues reported regarding camcontrol devlist not showing the rebuild states of volumes unless an explicit camcontrol rescan was executed. Modified: stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Fri Apr 19 05:13:57 2013 (r249634) +++ stable/9/sys/dev/ciss/ciss.c Fri Apr 19 05:28:08 2013 (r249635) @@ -3965,7 +3965,8 @@ static void ciss_notify_logical(struct ciss_softc *sc, struct ciss_notify *cn) { struct ciss_ldrive *ld; - int ostatus, bus, target; + int bus, target; + int rescan_ld; debug_called(2); @@ -3988,7 +3989,6 @@ ciss_notify_logical(struct ciss_softc *s /* * Update our idea of the drive's status. */ - ostatus = ciss_decode_ldrive_status(cn->data.logical_status.previous_state); ld->cl_status = ciss_decode_ldrive_status(cn->data.logical_status.new_state); if (ld->cl_lstatus != NULL) ld->cl_lstatus->status = cn->data.logical_status.new_state; @@ -3996,7 +3996,9 @@ ciss_notify_logical(struct ciss_softc *s /* * Have CAM rescan the drive if its status has changed. */ - if (ostatus != ld->cl_status) { + rescan_ld = (cn->data.logical_status.previous_state != + cn->data.logical_status.new_state) ? 1 : 0; + if (rescan_ld) { ld->cl_update = 1; ciss_notify_rescan_logical(sc); } From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 19 09:19:12 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C11F866; Fri, 19 Apr 2013 09:19:12 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ECE05697; Fri, 19 Apr 2013 09:19:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3J9JBdp035892; Fri, 19 Apr 2013 09:19:11 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3J9JA19035885; Fri, 19 Apr 2013 09:19:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304190919.r3J9JA19035885@svn.freebsd.org> From: Martin Matuska Date: Fri, 19 Apr 2013 09:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249643 - in stable/9: . cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 09:19:12 -0000 Author: mm Date: Fri Apr 19 09:19:10 2013 New Revision: 249643 URL: http://svnweb.freebsd.org/changeset/base/249643 Log: MFC 248571,248976,249004,249042,249188,249195-249196,249206,249207,249319, 249326,249356-249357 Merge libzfs_core and other ZFS bugfixes and improvements. MFC r248571: MFV 238590, 238592: In the first zfs ioctl restructuring phase, the libzfs_core library was introduced. It is a new thin library that wraps around kernel ioctl's. The idea is to provide a forward-compatible way of dealing with new features. Arguments are passed in nvlists and not random zfs_cmd fields, new-style ioctls are logged to pool history using a new method of history logging. http://blog.delphix.com/matt/2012/01/17/the-future-of-libzfs/ MFV 247580 [1]: To address issues of several deadlocks and race conditions the locking code around dsl_dataset was rewritten and the interface to synctasks was changed. User-Visible Changes: "zfs snapshot" can create more arbitrary snapshots at once (atomically) "zfs destroy" destroys multiple snapshots at once "zfs recv" has improved performance Backward Compatibility: I have extended the compatibility layer to support full backward compatibility by remapping or rewriting the responsible ioctl arguments. Old utilities are fully supported by the new kernel module. Forward Compatibility: New utilities work with old kernels with the following restrictions: - creating, destroying, holding and releasing of multiple snapshots at once is not supported, this includes recursive (-r) commands Illumos ZFS issues: 2882 implement libzfs_core 2900 "zfs snapshot" should be able to create multiple, arbitrary snapshots at once 3464 zfs synctask code needs restructuring MFC r248976: Call dmu_snapshot_list_next() in zvol.c with dsl_pool_config lock held MFC r249004: Do not check against uninitialized rc and comment out vendor code MFC r249042: Fix possible pool hold leak in dmu_send_impl() Illumos ZFS issues: 3645 dmu_send_impl: possibilty of pool hold leak MFC r249188: Import vendor change to reduce diff, no effect on FreeBSD. Illumos ZFS issues: 3517 importing pool with autoreplace=on and "hole" vdevs crashes syseventd MFC r249195: Merge change from vendor to reduce diff only. ZFS dtrace probes are not supported on FreeBSD yet. Illumos ZFS issues: 3598 want to dtrace when errors are generated in zfs MFC r249196: Provide a fix for kernel panic if receiving recursive deduplicated streams. Problem reported to vendor. Illumos ZFS issues: 3692 Panic on zfs receive of a recursive deduplicated stream MFC r249206: Merge vendor change - modify time processing in deadman thread. Illumos ZFS issues: 3618 ::zio dcmd does not show timestamp data MFC r249207: Allow zdb to output a histogram of compressed block sizes. Illumos ZFS issues: 3641 want a histogram of compressed block sizes MFC r249319: ZFS expects a copyout of zfs_cmd_t on an ioctl error. Our sys_ioctl() doesn't copyout in this case. To solve this a new struct zfs_iocparm_t is introduced consisting of: - zfs_ioctl_version (future backwards compatibility purposes) - user space pointer to zfs_cmd_t (copyin and copyout) - size of zfs_cmd_t (verification purposes) The copyin and copyout of zfs_cmd_t is now done the illumos (vendor) way what makes porting of new changes easier and ensures correct behavior if returning an error. MFC r249326: Cast (void *)(uintptr_t) on copyout and copyin of zfs_iocparm_t.zfs_cmd MFC r249356: Merge bugfixes accepted and integrated by vendor. Underlying problems have been reported by us and fixed in r240942 and r249196. Illumos ZFS issues: 3645 dmu_send_impl: possibilty of pool hold leak 3692 Panic on zfs receive of a recursive deduplicated stream MFC r249357: Fix libzfs to report error instead of returning zero if trying to hold or release a non-existing snapshot of a existing dataset. In recursive case error is reported if no snapshots with the requested name have been found. Illumos ZFS issues: 3699 zfs hold or release of a non-existent snapshot does not output error Added: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c - copied, changed from r248571, head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h - copied unchanged from r248571, head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h stable/9/cddl/contrib/opensolaris/lib/libzfs_core/ - copied from r248571, head/cddl/contrib/opensolaris/lib/libzfs_core/ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/zfs.d - copied unchanged from r249195, head/cddl/contrib/opensolaris/lib/libzpool/common/zfs.d stable/9/cddl/lib/libzfs_core/ - copied from r248571, head/cddl/lib/libzfs_core/ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c - copied, changed from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c - copied, changed from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h - copied unchanged from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_send.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h - copied unchanged from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_userhold.h - copied unchanged from r248571, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_userhold.h Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_iter.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/9/cddl/lib/Makefile stable/9/cddl/lib/libzfs/Makefile stable/9/cddl/sbin/zfs/Makefile stable/9/cddl/sbin/zpool/Makefile stable/9/cddl/usr.bin/zinject/Makefile stable/9/cddl/usr.bin/ztest/Makefile stable/9/cddl/usr.sbin/zdb/Makefile stable/9/cddl/usr.sbin/zhack/Makefile stable/9/rescue/rescue/Makefile stable/9/share/mk/bsd.libnames.mk stable/9/sys/cddl/compat/opensolaris/sys/cred.h stable/9/sys/cddl/compat/opensolaris/sys/sdt.h stable/9/sys/cddl/contrib/opensolaris/common/nvpair/fnvpair.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h stable/9/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/feature_tests.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/cddl/lib/ (props changed) stable/9/rescue/rescue/ (props changed) stable/9/share/mk/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/Makefile.inc1 Fri Apr 19 09:19:10 2013 (r249643) @@ -1321,6 +1321,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ ${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \ + ${_cddl_lib_libzfs_core} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1340,7 +1341,9 @@ lib/libopie__L lib/libtacplus__L: lib/li .if ${MK_CDDL} != "no" _cddl_lib_libumem= cddl/lib/libumem _cddl_lib_libnvpair= cddl/lib/libnvpair +_cddl_lib_libzfs_core= cddl/lib/libzfs_core _cddl_lib= cddl/lib +cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L .endif .if ${MK_CRYPT} != "no" Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Apr 19 09:19:10 2013 (r249643) @@ -21,10 +21,11 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include +#include #include #include #include @@ -57,6 +58,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -206,6 +208,27 @@ dump_packed_nvlist(objset_t *os, uint64_ nvlist_free(nv); } +/* ARGSUSED */ +static void +dump_history_offsets(objset_t *os, uint64_t object, void *data, size_t size) +{ + spa_history_phys_t *shp = data; + + if (shp == NULL) + return; + + (void) printf("\t\tpool_create_len = %llu\n", + (u_longlong_t)shp->sh_pool_create_len); + (void) printf("\t\tphys_max_off = %llu\n", + (u_longlong_t)shp->sh_phys_max_off); + (void) printf("\t\tbof = %llu\n", + (u_longlong_t)shp->sh_bof); + (void) printf("\t\teof = %llu\n", + (u_longlong_t)shp->sh_eof); + (void) printf("\t\trecords_lost = %llu\n", + (u_longlong_t)shp->sh_records_lost); +} + static void zdb_nicenum(uint64_t num, char *buf) { @@ -215,18 +238,18 @@ zdb_nicenum(uint64_t num, char *buf) nicenum(num, buf); } -const char dump_zap_stars[] = "****************************************"; -const int dump_zap_width = sizeof (dump_zap_stars) - 1; +const char histo_stars[] = "****************************************"; +const int histo_width = sizeof (histo_stars) - 1; static void -dump_zap_histogram(uint64_t histo[ZAP_HISTOGRAM_SIZE]) +dump_histogram(const uint64_t *histo, int size) { int i; - int minidx = ZAP_HISTOGRAM_SIZE - 1; + int minidx = size - 1; int maxidx = 0; uint64_t max = 0; - for (i = 0; i < ZAP_HISTOGRAM_SIZE; i++) { + for (i = 0; i < size; i++) { if (histo[i] > max) max = histo[i]; if (histo[i] > 0 && i > maxidx) @@ -235,12 +258,14 @@ dump_zap_histogram(uint64_t histo[ZAP_HI minidx = i; } - if (max < dump_zap_width) - max = dump_zap_width; + if (max < histo_width) + max = histo_width; - for (i = minidx; i <= maxidx; i++) - (void) printf("\t\t\t%u: %6llu %s\n", i, (u_longlong_t)histo[i], - &dump_zap_stars[(max - histo[i]) * dump_zap_width / max]); + for (i = minidx; i <= maxidx; i++) { + (void) printf("\t\t\t%3u: %6llu %s\n", + i, (u_longlong_t)histo[i], + &histo_stars[(max - histo[i]) * histo_width / max]); + } } static void @@ -291,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_zap_histogram(zs.zs_leafs_with_2n_pointers); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_zap_histogram(zs.zs_blocks_with_n5_entries); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tBlocks n/10 full:\n"); - dump_zap_histogram(zs.zs_blocks_n_tenths_full); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tEntries with n chunks:\n"); - dump_zap_histogram(zs.zs_entries_using_n_chunks); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); (void) printf("\t\tBuckets with n entries:\n"); - dump_zap_histogram(zs.zs_buckets_with_n_entries); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); } /*ARGSUSED*/ @@ -857,21 +882,22 @@ dump_history(spa_t *spa) for (int i = 0; i < num; i++) { uint64_t time, txg, ievent; char *cmd, *intstr; + boolean_t printed = B_FALSE; if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME, &time) != 0) - continue; + goto next; if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD, &cmd) != 0) { if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_INT_EVENT, &ievent) != 0) - continue; + goto next; verify(nvlist_lookup_uint64(events[i], ZPOOL_HIST_TXG, &txg) == 0); verify(nvlist_lookup_string(events[i], ZPOOL_HIST_INT_STR, &intstr) == 0); - if (ievent >= LOG_END) - continue; + if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) + goto next; (void) snprintf(internalstr, sizeof (internalstr), @@ -884,6 +910,14 @@ dump_history(spa_t *spa) (void) localtime_r(&tsec, &t); (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); (void) printf("%s %s\n", tbuf, cmd); + printed = B_TRUE; + +next: + if (dump_opt['h'] > 1) { + if (!printed) + (void) printf("unrecognized record:\n"); + dump_nvlist(events[i], 2); + } } } @@ -916,7 +950,7 @@ sprintf_blkptr_compact(char *blkbuf, con const dva_t *dva = bp->blk_dva; int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1; - if (dump_opt['b'] >= 5) { + if (dump_opt['b'] >= 6) { sprintf_blkptr(blkbuf, bp); return; } @@ -1496,7 +1530,7 @@ static object_viewer_t *object_viewer[DM dump_zap, /* other ZAP */ dump_zap, /* persistent error log */ dump_uint8, /* SPA history */ - dump_uint64, /* SPA history offsets */ + dump_history_offsets, /* SPA history offsets */ dump_zap, /* Pool properties */ dump_zap, /* DSL permissions */ dump_acl, /* ZFS ACL */ @@ -1661,7 +1695,9 @@ dump_dir(objset_t *os) int print_header = 1; int i, error; + dsl_pool_config_enter(dmu_objset_pool(os), FTAG); dmu_objset_fast_stat(os, &dds); + dsl_pool_config_exit(dmu_objset_pool(os), FTAG); if (dds.dds_type < DMU_OST_NUMTYPES) type = objset_types[dds.dds_type]; @@ -1953,11 +1989,13 @@ dump_one_dir(const char *dsname, void *a /* * Block statistics. */ +#define PSIZE_HISTO_SIZE (SPA_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1) typedef struct zdb_blkstats { - uint64_t zb_asize; - uint64_t zb_lsize; - uint64_t zb_psize; - uint64_t zb_count; + uint64_t zb_asize; + uint64_t zb_lsize; + uint64_t zb_psize; + uint64_t zb_count; + uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE]; } zdb_blkstats_t; /* @@ -1981,6 +2019,9 @@ typedef struct zdb_cb { zdb_blkstats_t zcb_type[ZB_TOTAL + 1][ZDB_OT_TOTAL + 1]; uint64_t zcb_dedup_asize; uint64_t zcb_dedup_blocks; + uint64_t zcb_start; + uint64_t zcb_lastprint; + uint64_t zcb_totalasize; uint64_t zcb_errors[256]; int zcb_readfails; int zcb_haderrors; @@ -2007,6 +2048,7 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t * zb->zb_lsize += BP_GET_LSIZE(bp); zb->zb_psize += BP_GET_PSIZE(bp); zb->zb_count++; + zb->zb_psize_histogram[BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT]++; } if (dump_opt['L']) @@ -2070,7 +2112,6 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog NULL, NULL, ZIO_PRIORITY_ASYNC_READ, flags, zb)); free(data); - if (ioerr && !(flags & ZIO_FLAG_SPECULATIVE)) { zcb->zcb_haderrors = 1; zcb->zcb_errors[ioerr]++; @@ -2094,7 +2135,7 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] >= 4) { + if (dump_opt['b'] >= 5) { sprintf_blkptr(blkbuf, bp); (void) printf("objset %llu object %llu " "level %lld offset 0x%llx %s\n", @@ -2105,6 +2146,28 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog blkbuf); } + if (dump_opt['b'] < 5 && isatty(STDERR_FILENO) && + gethrtime() > zcb->zcb_lastprint + NANOSEC) { + uint64_t now = gethrtime(); + char buf[10]; + uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize; + int kb_per_sec = + 1 + bytes / (1 + ((now - zcb->zcb_start) / 1000 / 1000)); + int sec_remaining = + (zcb->zcb_totalasize - bytes) / 1024 / kb_per_sec; + + zfs_nicenum(bytes, buf, sizeof (buf)); + (void) fprintf(stderr, + "\r%5s completed (%4dMB/s) " + "estimated time remaining: %uhr %02umin %02usec ", + buf, kb_per_sec / 1024, + sec_remaining / 60 / 60, + sec_remaining / 60 % 60, + sec_remaining % 60); + + zcb->zcb_lastprint = now; + } + return (0); } @@ -2236,7 +2299,7 @@ count_block_cb(void *arg, const blkptr_t { zdb_cb_t *zcb = arg; - if (dump_opt['b'] >= 4) { + if (dump_opt['b'] >= 5) { char blkbuf[BP_SPRINTF_LEN]; sprintf_blkptr(blkbuf, bp); (void) printf("[%s] %s\n", @@ -2255,7 +2318,7 @@ dump_block_stats(spa_t *spa) int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD; int leaks = 0; - (void) printf("\nTraversing all blocks %s%s%s%s%s...\n", + (void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n", (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "", (dump_opt['c'] == 1) ? "metadata " : "", dump_opt['c'] ? "checksums " : "", @@ -2291,6 +2354,8 @@ dump_block_stats(spa_t *spa) if (dump_opt['c'] > 1) flags |= TRAVERSE_PREFETCH_DATA; + zcb.zcb_totalasize = metaslab_class_get_alloc(spa_normal_class(spa)); + zcb.zcb_start = zcb.zcb_lastprint = gethrtime(); zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb); if (zcb.zcb_haderrors) { @@ -2418,6 +2483,14 @@ dump_block_stats(spa_t *spa) else (void) printf(" L%d %s\n", level, typename); + + if (dump_opt['b'] >= 4) { + (void) printf("psize " + "(in 512-byte sectors): " + "number of blocks\n"); + dump_histogram(zb->zb_psize_histogram, + PSIZE_HISTO_SIZE); + } } } } Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 19 09:19:10 2013 (r249643) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 1, 2013 +.Dd March 21, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -65,6 +65,7 @@ .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns Ar volume@snapname +.Ar filesystem@snapname Ns | Ns Ar volume@snapname Ns ... .Nm .Cm rollback .Op Fl rRf @@ -1609,7 +1610,11 @@ multiple snapshots. Destroy (or mark for deferred deletion) all snapshots with this name in descendent file systems. .It Fl R -Recursively destroy all dependents. +Recursively destroy all clones of these snapshots, including the clones, +snapshots, and children. +If this flag is specified, the +.Op fl d +flag will have no effect. .It Fl n Do a dry-run ("No-op") deletion. No data will be deleted. This is useful in conjunction with the @@ -1637,17 +1642,18 @@ behavior for mounted file systems in use .Op Fl r .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ... .Ar filesystem@snapname Ns | Ns volume@snapname +.Ar filesystem@snapname Ns | Ns volume@snapname Ns ... .Xc .Pp -Creates a snapshot with the given name. All previous modifications by -successful system calls to the file system are part of the snapshot. See the +Creates snapshots with the given names. All previous modifications by +successful system calls to the file system are part of the snapshots. +Snapshots are taken atomically, so that all snapshots correspond to the same +moment in time. See the .Qq Sx Snapshots section for details. .Bl -tag -width indent .It Fl r -Recursively create snapshots of all descendent datasets. Snapshots are taken -atomically, so that all recursive snapshots correspond to the same moment in -time. +Recursively create snapshots of all descendent datasets .It Fl o Ar property Ns = Ns Ar value Sets the specified property; see .Qq Nm Cm create Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 19 09:19:10 2013 (r249643) @@ -58,6 +58,7 @@ #include #include +#include #include #include #include @@ -74,6 +75,7 @@ libzfs_handle_t *g_zfs; static FILE *mnttab_file; static char history_str[HIS_MAX_RECORD_LEN]; +static boolean_t log_history = B_TRUE; static int zfs_do_clone(int argc, char **argv); static int zfs_do_create(int argc, char **argv); @@ -276,7 +278,7 @@ get_usage(zfs_help_t idx) return (gettext("\tshare <-a | filesystem>\n")); case HELP_SNAPSHOT: return (gettext("\tsnapshot [-r] [-o property=value] ... " - "\n")); + " ...\n")); case HELP_UNMOUNT: return (gettext("\tunmount [-f] " "<-a | filesystem|mountpoint>\n")); @@ -903,11 +905,12 @@ typedef struct destroy_cbdata { boolean_t cb_parsable; boolean_t cb_dryrun; nvlist_t *cb_nvl; + nvlist_t *cb_batchedsnaps; /* first snap in contiguous run */ - zfs_handle_t *cb_firstsnap; + char *cb_firstsnap; /* previous snap in contiguous run */ - zfs_handle_t *cb_prevsnap; + char *cb_prevsnap; int64_t cb_snapused; char *cb_snapspec; } destroy_cbdata_t; @@ -999,9 +1002,27 @@ destroy_callback(zfs_handle_t *zhp, void zfs_close(zhp); return (0); } + if (cb->cb_dryrun) { + zfs_close(zhp); + return (0); + } + + /* + * We batch up all contiguous snapshots (even of different + * filesystems) and destroy them with one ioctl. We can't + * simply do all snap deletions and then all fs deletions, + * because we must delete a clone before its origin. + */ + if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) { + fnvlist_add_boolean(cb->cb_batchedsnaps, name); + } else { + int error = zfs_destroy_snaps_nvl(g_zfs, + cb->cb_batchedsnaps, B_FALSE); + fnvlist_free(cb->cb_batchedsnaps); + cb->cb_batchedsnaps = fnvlist_alloc(); - if (!cb->cb_dryrun) { - if (zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 || + if (error != 0 || + zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 || zfs_destroy(zhp, cb->cb_defer_destroy) != 0) { zfs_close(zhp); return (-1); @@ -1021,11 +1042,13 @@ destroy_print_cb(zfs_handle_t *zhp, void if (nvlist_exists(cb->cb_nvl, name)) { if (cb->cb_firstsnap == NULL) - cb->cb_firstsnap = zfs_handle_dup(zhp); + cb->cb_firstsnap = strdup(name); if (cb->cb_prevsnap != NULL) - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); /* this snap continues the current range */ - cb->cb_prevsnap = zfs_handle_dup(zhp); + cb->cb_prevsnap = strdup(name); + if (cb->cb_firstsnap == NULL || cb->cb_prevsnap == NULL) + nomem(); if (cb->cb_verbose) { if (cb->cb_parsable) { (void) printf("destroy\t%s\n", name); @@ -1040,12 +1063,12 @@ destroy_print_cb(zfs_handle_t *zhp, void } else if (cb->cb_firstsnap != NULL) { /* end of this range */ uint64_t used = 0; - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } zfs_close(zhp); @@ -1062,13 +1085,13 @@ destroy_print_snapshots(zfs_handle_t *fs if (cb->cb_firstsnap != NULL) { uint64_t used = 0; if (err == 0) { - err = zfs_get_snapused_int(cb->cb_firstsnap, + err = lzc_snaprange_space(cb->cb_firstsnap, cb->cb_prevsnap, &used); } cb->cb_snapused += used; - zfs_close(cb->cb_firstsnap); + free(cb->cb_firstsnap); cb->cb_firstsnap = NULL; - zfs_close(cb->cb_prevsnap); + free(cb->cb_prevsnap); cb->cb_prevsnap = NULL; } return (err); @@ -1155,8 +1178,10 @@ static int zfs_do_destroy(int argc, char **argv) { destroy_cbdata_t cb = { 0 }; + int rv = 0; + int err = 0; int c; - zfs_handle_t *zhp; + zfs_handle_t *zhp = NULL; char *at; zfs_type_t type = ZFS_TYPE_DATASET; @@ -1210,11 +1235,9 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ - if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) - nomem(); + cb.cb_nvl = fnvlist_alloc(); *at = '\0'; zhp = zfs_open(g_zfs, argv[0], @@ -1225,17 +1248,15 @@ zfs_do_destroy(int argc, char **argv) cb.cb_snapspec = at + 1; if (gather_snapshots(zfs_handle_dup(zhp), &cb) != 0 || cb.cb_error) { - zfs_close(zhp); - nvlist_free(cb.cb_nvl); - return (1); + rv = 1; + goto out; } if (nvlist_empty(cb.cb_nvl)) { (void) fprintf(stderr, gettext("could not find any " "snapshots to destroy; check snapshot names.\n")); - zfs_close(zhp); - nvlist_free(cb.cb_nvl); - return (1); + rv = 1; + goto out; } if (cb.cb_verbose) { @@ -1254,18 +1275,26 @@ zfs_do_destroy(int argc, char **argv) } if (!cb.cb_dryrun) { - if (cb.cb_doclones) + if (cb.cb_doclones) { + cb.cb_batchedsnaps = fnvlist_alloc(); err = destroy_clones(&cb); + if (err == 0) { + err = zfs_destroy_snaps_nvl(g_zfs, + cb.cb_batchedsnaps, B_FALSE); + } + if (err != 0) { + rv = 1; + goto out; + } + } if (err == 0) { - err = zfs_destroy_snaps_nvl(zhp, cb.cb_nvl, + err = zfs_destroy_snaps_nvl(g_zfs, cb.cb_nvl, cb.cb_defer_destroy); } } - zfs_close(zhp); - nvlist_free(cb.cb_nvl); if (err != 0) - return (1); + rv = 1; } else { /* Open the given dataset */ if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL) @@ -1286,8 +1315,8 @@ zfs_do_destroy(int argc, char **argv) zfs_get_name(zhp)); (void) fprintf(stderr, gettext("use 'zpool destroy %s' " "to destroy the pool itself\n"), zfs_get_name(zhp)); - zfs_close(zhp); - return (1); + rv = 1; + goto out; } /* @@ -1297,30 +1326,42 @@ zfs_do_destroy(int argc, char **argv) if (!cb.cb_doclones && zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent, &cb) != 0) { - zfs_close(zhp); - return (1); + rv = 1; + goto out; } if (cb.cb_error) { - zfs_close(zhp); - return (1); + rv = 1; + goto out; } + cb.cb_batchedsnaps = fnvlist_alloc(); if (zfs_iter_dependents(zhp, B_FALSE, destroy_callback, &cb) != 0) { - zfs_close(zhp); - return (1); + rv = 1; + goto out; } /* * Do the real thing. The callback will close the * handle regardless of whether it succeeds or not. */ - if (destroy_callback(zhp, &cb) != 0) - return (1); + err = destroy_callback(zhp, &cb); + zhp = NULL; + if (err == 0) { + err = zfs_destroy_snaps_nvl(g_zfs, + cb.cb_batchedsnaps, cb.cb_defer_destroy); + } + if (err != 0) + rv = 1; } - return (0); +out: + fnvlist_free(cb.cb_batchedsnaps); + fnvlist_free(cb.cb_nvl); + if (zhp != NULL) + zfs_close(zhp); + return (rv); } static boolean_t @@ -1921,9 +1962,11 @@ upgrade_set_callback(zfs_handle_t *zhp, /* * If they did "zfs upgrade -a", then we could * be doing ioctls to different pools. We need - * to log this history once to each pool. + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). */ - verify(zpool_stage_history(g_zfs, history_str) == 0); + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } if (zfs_prop_set(zhp, "version", verstr) == 0) cb->cb_numupgraded++; @@ -3461,6 +3504,32 @@ zfs_do_set(int argc, char **argv) return (ret); } +typedef struct snap_cbdata { + nvlist_t *sd_nvl; + boolean_t sd_recursive; + const char *sd_snapname; +} snap_cbdata_t; + +static int +zfs_snapshot_cb(zfs_handle_t *zhp, void *arg) +{ + snap_cbdata_t *sd = arg; + char *name; + int rv = 0; + int error; + + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (error == -1) + nomem(); + fnvlist_add_boolean(sd->sd_nvl, name); + free(name); + + if (sd->sd_recursive) + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + zfs_close(zhp); + return (rv); +} + /* * zfs snapshot [-r] [-o prop=value] ... * @@ -3470,13 +3539,16 @@ zfs_do_set(int argc, char **argv) static int zfs_do_snapshot(int argc, char **argv) { - boolean_t recursive = B_FALSE; int ret = 0; char c; nvlist_t *props; + snap_cbdata_t sd = { 0 }; + boolean_t multiple_snaps = B_FALSE; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) nomem(); + if (nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) != 0) + nomem(); /* check options */ while ((c = getopt(argc, argv, "ro:")) != -1) { @@ -3486,7 +3558,8 @@ zfs_do_snapshot(int argc, char **argv) return (1); break; case 'r': - recursive = B_TRUE; + sd.sd_recursive = B_TRUE; + multiple_snaps = B_TRUE; break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), @@ -3503,18 +3576,35 @@ zfs_do_snapshot(int argc, char **argv) (void) fprintf(stderr, gettext("missing snapshot argument\n")); goto usage; } - if (argc > 1) { - (void) fprintf(stderr, gettext("too many arguments\n")); - goto usage; + + if (argc > 1) + multiple_snaps = B_TRUE; + for (; argc > 0; argc--, argv++) { + char *atp; + zfs_handle_t *zhp; + + atp = strchr(argv[0], '@'); + if (atp == NULL) + goto usage; + *atp = '\0'; + sd.sd_snapname = atp + 1; + zhp = zfs_open(g_zfs, argv[0], + ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME); + if (zhp == NULL) + goto usage; + if (zfs_snapshot_cb(zhp, &sd) != 0) + goto usage; } - ret = zfs_snapshot(g_zfs, argv[0], recursive, props); + ret = zfs_snapshot_nvl(g_zfs, sd.sd_nvl, props); + nvlist_free(sd.sd_nvl); nvlist_free(props); - if (ret && recursive) + if (ret != 0 && multiple_snaps) (void) fprintf(stderr, gettext("no snapshots were created\n")); return (ret != 0); usage: + nvlist_free(sd.sd_nvl); nvlist_free(props); usage(B_FALSE); return (-1); @@ -5057,28 +5147,12 @@ cleanup2: return (error); } -/* - * zfs allow [-r] [-t] ... - * - * -r Recursively hold - * -t Temporary hold (hidden option) - * - * Apply a user-hold with the given tag to the list of snapshots. - */ static int zfs_do_allow(int argc, char **argv) { return (zfs_do_allow_unallow_impl(argc, argv, B_FALSE)); } -/* - * zfs unallow [-r] [-t] ... - * - * -r Recursively hold - * -t Temporary hold (hidden option) - * - * Apply a user-hold with the given tag to the list of snapshots. - */ static int zfs_do_unallow(int argc, char **argv) { @@ -5092,7 +5166,6 @@ zfs_do_hold_rele_impl(int argc, char **a int i; const char *tag; boolean_t recursive = B_FALSE; - boolean_t temphold = B_FALSE; const char *opts = holding ? "rt" : "r"; int c; @@ -5102,9 +5175,6 @@ zfs_do_hold_rele_impl(int argc, char **a case 'r': recursive = B_TRUE; break; - case 't': - temphold = B_TRUE; - break; case '?': (void) fprintf(stderr, gettext("invalid option '%c'\n"), optopt); @@ -5153,7 +5223,7 @@ zfs_do_hold_rele_impl(int argc, char **a } if (holding) { if (zfs_hold(zhp, delim+1, tag, recursive, - temphold, B_FALSE, -1, 0, 0) != 0) + B_FALSE, -1) != 0) ++errors; } else { if (zfs_release(zhp, delim+1, tag, recursive) != 0) @@ -5169,7 +5239,6 @@ zfs_do_hold_rele_impl(int argc, char **a * zfs hold [-r] [-t] ... * * -r Recursively hold - * -t Temporary hold (hidden option) * * Apply a user-hold with the given tag to the list of snapshots. */ @@ -6591,8 +6660,7 @@ main(int argc, char **argv) return (1); } - zpool_set_history_str("zfs", argc, argv, history_str); - verify(zpool_stage_history(g_zfs, history_str) == 0); + zfs_save_arguments(argc, argv, history_str, sizeof (history_str)); libzfs_print_on_error(g_zfs, B_TRUE); @@ -6661,6 +6729,9 @@ main(int argc, char **argv) (void) fclose(mnttab_file); + if (ret == 0 && log_history) + (void) zpool_log_history(g_zfs, history_str); + libzfs_fini(g_zfs); /* Modified: stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Apr 19 09:19:10 2013 (r249643) @@ -46,6 +46,7 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include @@ -273,12 +274,15 @@ zhack_do_feature_stat(int argc, char **a } static void -feature_enable_sync(void *arg1, void *arg2, dmu_tx_t *tx) +feature_enable_sync(void *arg, dmu_tx_t *tx) { - spa_t *spa = arg1; - zfeature_info_t *feature = arg2; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + zfeature_info_t *feature = arg; spa_feature_enable(spa, feature, tx); + spa_history_log_internal(spa, "zhack enable feature", tx, + "name=%s can_readonly=%u", + feature->fi_guid, feature->fi_can_readonly); } static void @@ -341,8 +345,8 @@ zhack_do_feature_enable(int argc, char * if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid)) fatal("feature already enabled: %s", feature.fi_guid); - VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL, - feature_enable_sync, spa, &feature, 5)); + VERIFY0(dsl_sync_task(spa_name(spa), NULL, + feature_enable_sync, &feature, 5)); spa_close(spa, FTAG); @@ -350,21 +354,25 @@ zhack_do_feature_enable(int argc, char * } static void -feature_incr_sync(void *arg1, void *arg2, dmu_tx_t *tx) +feature_incr_sync(void *arg, dmu_tx_t *tx) { - spa_t *spa = arg1; - zfeature_info_t *feature = arg2; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + zfeature_info_t *feature = arg; spa_feature_incr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature incr", tx, + "name=%s", feature->fi_guid); } static void -feature_decr_sync(void *arg1, void *arg2, dmu_tx_t *tx) +feature_decr_sync(void *arg, dmu_tx_t *tx) { - spa_t *spa = arg1; - zfeature_info_t *feature = arg2; + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + zfeature_info_t *feature = arg; spa_feature_decr(spa, feature, tx); + spa_history_log_internal(spa, "zhack feature decr", tx, + "name=%s", feature->fi_guid); } static void @@ -435,8 +443,8 @@ zhack_do_feature_ref(int argc, char **ar if (decr && !spa_feature_is_active(spa, &feature)) fatal("feature refcount already 0: %s", feature.fi_guid); - VERIFY3U(0, ==, dsl_sync_task_do(spa->spa_dsl_pool, NULL, - decr ? feature_decr_sync : feature_incr_sync, spa, &feature, 5)); + VERIFY0(dsl_sync_task(spa_name(spa), NULL, + decr ? feature_decr_sync : feature_incr_sync, &feature, 5)); spa_close(spa, FTAG); } Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 19 08:06:45 2013 (r249642) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Apr 19 09:19:10 2013 (r249643) @@ -192,9 +192,9 @@ static zpool_command_t command_table[] = #define NCOMMAND (sizeof (command_table) / sizeof (command_table[0])) -zpool_command_t *current_command; +static zpool_command_t *current_command; static char history_str[HIS_MAX_RECORD_LEN]; - +static boolean_t log_history = B_TRUE; static uint_t timestamp_fmt = NODATE; static const char * @@ -1092,7 +1092,10 @@ zpool_do_destroy(int argc, char **argv) return (1); } - ret = (zpool_destroy(zhp) != 0); + /* The history must be logged as part of the export */ + log_history = B_FALSE; + + ret = (zpool_destroy(zhp, history_str) != 0); zpool_close(zhp); @@ -1156,10 +1159,13 @@ zpool_do_export(int argc, char **argv) continue; } + /* The history must be logged as part of the export */ + log_history = B_FALSE; + if (hardforce) { - if (zpool_export_force(zhp) != 0) + if (zpool_export_force(zhp, history_str) != 0) ret = 1; - } else if (zpool_export(zhp, force) != 0) { + } else if (zpool_export(zhp, force, history_str) != 0) { ret = 1; } @@ -4562,6 +4568,14 @@ upgrade_cb(zpool_handle_t *zhp, void *ar if (count > 0) { cbp->cb_first = B_FALSE; printnl = B_TRUE; + /* + * If they did "zpool upgrade -a", then we could + * be doing ioctls to different pools. We need + * to log this history once to each pool, and bypass + * the normal history logging that happens in main(). + */ + (void) zpool_log_history(g_zfs, history_str); + log_history = B_FALSE; } } @@ -4923,8 +4937,8 @@ zpool_do_upgrade(int argc, char **argv) typedef struct hist_cbdata { boolean_t first; - int longfmt; - int internal; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 19 19:28:49 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8DB8C1B5; Fri, 19 Apr 2013 19:28:49 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C58F18AB; Fri, 19 Apr 2013 19:28:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JJSn37053762; Fri, 19 Apr 2013 19:28:49 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JJSn2f053749; Fri, 19 Apr 2013 19:28:49 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201304191928.r3JJSn2f053749@svn.freebsd.org> From: Hiren Panchasara Date: Fri, 19 Apr 2013 19:28:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249655 - in stable/9: lib/libpmc sys/dev/hwpmc sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 19:28:49 -0000 Author: hiren Date: Fri Apr 19 19:28:48 2013 New Revision: 249655 URL: http://svnweb.freebsd.org/changeset/base/249655 Log: MFC: r248842 Update hwpmc to support Haswell class processors. 0x3C: /* Per Intel document 325462-045US 01/2013. */ Add manpage to document all the goodness that is available in this processor model. Approved by: sbruno (mentor) Added: stable/9/lib/libpmc/pmc.haswell.3 (contents, props changed) stable/9/lib/libpmc/pmc.haswelluc.3 (contents, props changed) Modified: stable/9/lib/libpmc/Makefile stable/9/lib/libpmc/libpmc.c stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c stable/9/sys/dev/hwpmc/hwpmc_uncore.c stable/9/sys/dev/hwpmc/pmc_events.h stable/9/sys/sys/pmc.h Directory Properties: stable/9/lib/libpmc/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/lib/libpmc/Makefile ============================================================================== --- stable/9/lib/libpmc/Makefile Fri Apr 19 18:45:03 2013 (r249654) +++ stable/9/lib/libpmc/Makefile Fri Apr 19 19:28:48 2013 (r249655) @@ -27,6 +27,8 @@ MAN+= pmc.soft.3 MAN+= pmc.atom.3 MAN+= pmc.core.3 MAN+= pmc.core2.3 +MAN+= pmc.haswell.3 +MAN+= pmc.haswelluc.3 MAN+= pmc.iaf.3 MAN+= pmc.ivybridge.3 MAN+= pmc.ivybridgexeon.3 Modified: stable/9/lib/libpmc/libpmc.c ============================================================================== --- stable/9/lib/libpmc/libpmc.c Fri Apr 19 18:45:03 2013 (r249654) +++ stable/9/lib/libpmc/libpmc.c Fri Apr 19 19:28:48 2013 (r249655) @@ -182,6 +182,11 @@ static const struct pmc_event_descr core __PMC_EV_ALIAS_COREI7() }; +static const struct pmc_event_descr haswell_event_table[] = +{ + __PMC_EV_ALIAS_HASWELL() +}; + static const struct pmc_event_descr ivybridge_event_table[] = { __PMC_EV_ALIAS_IVYBRIDGE() @@ -212,6 +217,11 @@ static const struct pmc_event_descr core __PMC_EV_ALIAS_COREI7UC() }; +static const struct pmc_event_descr haswelluc_event_table[] = +{ + __PMC_EV_ALIAS_HASWELLUC() +}; + static const struct pmc_event_descr sandybridgeuc_event_table[] = { __PMC_EV_ALIAS_SANDYBRIDGEUC() @@ -236,6 +246,7 @@ PMC_MDEP_TABLE(atom, IAP, PMC_CLASS_SOFT PMC_MDEP_TABLE(core, IAP, PMC_CLASS_SOFT, PMC_CLASS_TSC); PMC_MDEP_TABLE(core2, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(corei7, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); +PMC_MDEP_TABLE(haswell, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); PMC_MDEP_TABLE(ivybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(ivybridge_xeon, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC); PMC_MDEP_TABLE(sandybridge, IAP, PMC_CLASS_SOFT, PMC_CLASS_IAF, PMC_CLASS_TSC, PMC_CLASS_UCF, PMC_CLASS_UCP); @@ -275,6 +286,7 @@ PMC_CLASS_TABLE_DESC(atom, IAP, atom, ia PMC_CLASS_TABLE_DESC(core, IAP, core, iap); PMC_CLASS_TABLE_DESC(core2, IAP, core2, iap); PMC_CLASS_TABLE_DESC(corei7, IAP, corei7, iap); +PMC_CLASS_TABLE_DESC(haswell, IAP, haswell, iap); PMC_CLASS_TABLE_DESC(ivybridge, IAP, ivybridge, iap); PMC_CLASS_TABLE_DESC(ivybridge_xeon, IAP, ivybridge_xeon, iap); PMC_CLASS_TABLE_DESC(sandybridge, IAP, sandybridge, iap); @@ -282,6 +294,7 @@ PMC_CLASS_TABLE_DESC(sandybridge_xeon, I PMC_CLASS_TABLE_DESC(westmere, IAP, westmere, iap); PMC_CLASS_TABLE_DESC(ucf, UCF, ucf, ucf); PMC_CLASS_TABLE_DESC(corei7uc, UCP, corei7uc, ucp); +PMC_CLASS_TABLE_DESC(haswelluc, UCP, haswelluc, ucp); PMC_CLASS_TABLE_DESC(sandybridgeuc, UCP, sandybridgeuc, ucp); PMC_CLASS_TABLE_DESC(westmereuc, UCP, westmereuc, ucp); #endif @@ -579,6 +592,8 @@ static struct pmc_event_alias core2_alia #define atom_aliases_without_iaf core2_aliases_without_iaf #define corei7_aliases core2_aliases #define corei7_aliases_without_iaf core2_aliases_without_iaf +#define haswell_aliases core2_aliases +#define haswell_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_aliases core2_aliases #define ivybridge_aliases_without_iaf core2_aliases_without_iaf #define ivybridge_xeon_aliases core2_aliases @@ -737,6 +752,31 @@ static struct pmc_masks iap_rsp_mask_sb_ NULLMASK }; +static struct pmc_masks iap_rsp_mask_haswell[] = { + PMCMASK(REQ_DMND_DATA_RD, (1ULL << 0)), + PMCMASK(REQ_DMND_RFO, (1ULL << 1)), + PMCMASK(REQ_DMND_IFETCH, (1ULL << 2)), + PMCMASK(REQ_PF_DATA_RD, (1ULL << 4)), + PMCMASK(REQ_PF_RFO, (1ULL << 5)), + PMCMASK(REQ_PF_IFETCH, (1ULL << 6)), + PMCMASK(REQ_OTHER, (1ULL << 15)), + PMCMASK(RES_ANY, (1ULL << 16)), + PMCMASK(RES_SUPPLIER_SUPP, (1ULL << 17)), + PMCMASK(RES_SUPPLIER_LLC_HITM, (1ULL << 18)), + PMCMASK(RES_SUPPLIER_LLC_HITE, (1ULL << 19)), + PMCMASK(RES_SUPPLIER_LLC_HITS, (1ULL << 20)), + PMCMASK(RES_SUPPLIER_LLC_HITF, (1ULL << 21)), + PMCMASK(RES_SUPPLIER_LOCAL, (1ULL << 22)), + PMCMASK(RES_SNOOP_SNP_NONE, (1ULL << 31)), + PMCMASK(RES_SNOOP_SNP_NO_NEEDED,(1ULL << 32)), + PMCMASK(RES_SNOOP_SNP_MISS, (1ULL << 33)), + PMCMASK(RES_SNOOP_HIT_NO_FWD, (1ULL << 34)), + PMCMASK(RES_SNOOP_HIT_FWD, (1ULL << 35)), + PMCMASK(RES_SNOOP_HITM, (1ULL << 36)), + PMCMASK(RES_NON_DRAM, (1ULL << 37)), + NULLMASK +}; + static int iap_allocate_pmc(enum pmc_event pe, char *ctrspec, struct pmc_op_pmcallocate *pmc_config) @@ -819,6 +859,11 @@ iap_allocate_pmc(enum pmc_event pe, char n = pmc_parse_mask(iap_rsp_mask_sb_sbx_ib, p, &rsp); } else return (-1); + } else if (cpu_info.pm_cputype == PMC_CPU_INTEL_HASWELL) { + if (KWPREFIXMATCH(p, IAP_KW_RSP "=")) { + n = pmc_parse_mask(iap_rsp_mask_haswell, p, &rsp); + } else + return (-1); } else return (-1); @@ -2679,6 +2724,10 @@ pmc_event_names_of_class(enum pmc_class ev = corei7_event_table; count = PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_HASWELL: + ev = haswell_event_table; + count = PMC_EVENT_TABLE_SIZE(haswell); + break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; count = PMC_EVENT_TABLE_SIZE(ivybridge); @@ -2716,6 +2765,10 @@ pmc_event_names_of_class(enum pmc_class ev = corei7uc_event_table; count = PMC_EVENT_TABLE_SIZE(corei7uc); break; + case PMC_CPU_INTEL_HASWELL: + ev = haswelluc_event_table; + count = PMC_EVENT_TABLE_SIZE(haswelluc); + break; case PMC_CPU_INTEL_SANDYBRIDGE: ev = sandybridgeuc_event_table; count = PMC_EVENT_TABLE_SIZE(sandybridgeuc); @@ -2979,6 +3032,11 @@ pmc_init(void) pmc_class_table[n++] = &corei7uc_class_table_descr; PMC_MDEP_INIT_INTEL_V2(corei7); break; + case PMC_CPU_INTEL_HASWELL: + pmc_class_table[n++] = &ucf_class_table_descr; + pmc_class_table[n++] = &haswelluc_class_table_descr; + PMC_MDEP_INIT_INTEL_V2(haswell); + break; case PMC_CPU_INTEL_IVYBRIDGE: PMC_MDEP_INIT_INTEL_V2(ivybridge); break; @@ -3119,6 +3177,10 @@ _pmc_name_of_event(enum pmc_event pe, en ev = corei7_event_table; evfence = corei7_event_table + PMC_EVENT_TABLE_SIZE(corei7); break; + case PMC_CPU_INTEL_HASWELL: + ev = haswell_event_table; + evfence = haswell_event_table + PMC_EVENT_TABLE_SIZE(haswell); + break; case PMC_CPU_INTEL_IVYBRIDGE: ev = ivybridge_event_table; evfence = ivybridge_event_table + PMC_EVENT_TABLE_SIZE(ivybridge); Added: stable/9/lib/libpmc/pmc.haswell.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libpmc/pmc.haswell.3 Fri Apr 19 19:28:48 2013 (r249655) @@ -0,0 +1,975 @@ +.\" Copyright (c) 2013 Hiren Panchasara +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 22, 2013 +.Dt PMC.HASWELL 3 +.Os +.Sh NAME +.Nm pmc.haswell +.Nd measurement events for +.Tn Intel +.Tn Haswsell +family CPUs +.Sh LIBRARY +.Lb libpmc +.Sh SYNOPSIS +.In pmc.h +.Sh DESCRIPTION +.Tn Intel +.Tn "Haswell" +CPUs contain PMCs conforming to version 2 of the +.Tn Intel +performance measurement architecture. +These CPUs may contain up to two classes of PMCs: +.Bl -tag -width "Li PMC_CLASS_IAP" +.It Li PMC_CLASS_IAF +Fixed-function counters that count only one hardware event per counter. +.It Li PMC_CLASS_IAP +Programmable counters that may be configured to count one of a defined +set of hardware events. +.El +.Pp +The number of PMCs available in each class and their widths need to be +determined at run time by calling +.Xr pmc_cpuinfo 3 . +.Pp +Intel Haswell PMCs are documented in +.Rs +.%B "Intel(R) 64 and IA-32 Architectures Software Developer's Manual" +.%T "Combined Volumes: 1, 2A, 2B, 2C, 3A, 3B and 3C" +.%N "Order Number: 325462-045US" +.%D January 2013 +.%Q "Intel Corporation" +.Re +.Ss HASWELL FIXED FUNCTION PMCS +These PMCs and their supported events are documented in +.Xr pmc.iaf 3 . +.Ss HASWELL PROGRAMMABLE PMCS +The programmable PMCs support the following capabilities: +.Bl -column "PMC_CAP_INTERRUPT" "Support" +.It Em Capability Ta Em Support +.It PMC_CAP_CASCADE Ta \&No +.It PMC_CAP_EDGE Ta Yes +.It PMC_CAP_INTERRUPT Ta Yes +.It PMC_CAP_INVERT Ta Yes +.It PMC_CAP_READ Ta Yes +.It PMC_CAP_PRECISE Ta \&No +.It PMC_CAP_SYSTEM Ta Yes +.It PMC_CAP_TAGGING Ta \&No +.It PMC_CAP_THRESHOLD Ta Yes +.It PMC_CAP_USER Ta Yes +.It PMC_CAP_WRITE Ta Yes +.El +.Ss Event Qualifiers +Event specifiers for these PMCs support the following common +qualifiers: +.Bl -tag -width indent +.It Li rsp= Ns Ar value +Configure the Off-core Response bits. +.Bl -tag -width indent +.It Li DMND_DATA_RD +Counts the number of demand and DCU prefetch data reads of full +and partial cachelines as well as demand data page table entry +cacheline reads. Does not count L2 data read prefetches or +instruction fetches. +.It Li REQ_DMND_RFO +Counts the number of demand and DCU prefetch reads for ownership (RFO) +requests generated by a write to data cacheline. Does not count L2 RFO +prefetches. +.It Li REQ_DMND_IFETCH +Counts the number of demand and DCU prefetch instruction cacheline reads. +Does not count L2 code read prefetches. +.It Li REQ_WB +Counts the number of writeback (modified to exclusive) transactions. +.It Li REQ_PF_DATA_RD +Counts the number of data cacheline reads generated by L2 prefetchers. +.It Li REQ_PF_RFO +Counts the number of RFO requests generated by L2 prefetchers. +.It Li REQ_PF_IFETCH +Counts the number of code reads generated by L2 prefetchers. +.It Li REQ_PF_LLC_DATA_RD +L2 prefetcher to L3 for loads. +.It Li REQ_PF_LLC_RFO +RFO requests generated by L2 prefetcher +.It Li REQ_PF_LLC_IFETCH +L2 prefetcher to L3 for instruction fetches. +.It Li REQ_BUS_LOCKS +Bus lock and split lock requests. +.It Li REQ_STRM_ST +Streaming store requests. +.It Li REQ_OTHER +Any other request that crosses IDI, including I/O. +.It Li RES_ANY +Catch all value for any response types. +.It Li RES_SUPPLIER_NO_SUPP +No Supplier Information available. +.It Li RES_SUPPLIER_LLC_HITM +M-state initial lookup stat in L3. +.It Li RES_SUPPLIER_LLC_HITE +E-state. +.It Li RES_SUPPLIER_LLC_HITS +S-state. +.It Li RES_SUPPLIER_LLC_HITF +F-state. +.It Li RES_SUPPLIER_LOCAL +Local DRAM Controller. +.It Li RES_SNOOP_SNP_NONE +No details on snoop-related information. +.It Li RES_SNOOP_SNP_NO_NEEDED +No snoop was needed to satisfy the request. +.It Li RES_SNOOP_SNP_MISS +A snoop was needed and it missed all snooped caches: +-For LLC Hit, ReslHitl was returned by all cores +-For LLC Miss, Rspl was returned by all sockets and data was returned from +DRAM. +.It Li RES_SNOOP_HIT_NO_FWD +A snoop was needed and it hits in at least one snooped cache. Hit denotes a +cache-line was valid before snoop effect. This includes: +-Snoop Hit w/ Invalidation (LLC Hit, RFO) +-Snoop Hit, Left Shared (LLC Hit/Miss, IFetch/Data_RD) +-Snoop Hit w/ Invalidation and No Forward (LLC Miss, RFO Hit S) +In the LLC Miss case, data is returned from DRAM. +.It Li RES_SNOOP_HIT_FWD +A snoop was needed and data was forwarded from a remote socket. +This includes: +-Snoop Forward Clean, Left Shared (LLC Hit/Miss, IFetch/Data_RD/RFT). +.It Li RES_SNOOP_HITM +A snoop was needed and it HitM-ed in local or remote cache. HitM denotes a +cache-line was in modified state before effect as a results of snoop. This +includes: +-Snoop HitM w/ WB (LLC miss, IFetch/Data_RD) +-Snoop Forward Modified w/ Invalidation (LLC Hit/Miss, RFO) +-Snoop MtoS (LLC Hit, IFetch/Data_RD). +.It Li RES_NON_DRAM +Target was non-DRAM system address. This includes MMIO transactions. +.El +.It Li cmask= Ns Ar value +Configure the PMC to increment only if the number of configured +events measured in a cycle is greater than or equal to +.Ar value . +.It Li edge +Configure the PMC to count the number of de-asserted to asserted +transitions of the conditions expressed by the other qualifiers. +If specified, the counter will increment only once whenever a +condition becomes true, irrespective of the number of clocks during +which the condition remains true. +.It Li inv +Invert the sense of comparison when the +.Dq Li cmask +qualifier is present, making the counter increment when the number of +events per cycle is less than the value specified by the +.Dq Li cmask +qualifier. +.It Li os +Configure the PMC to count events happening at processor privilege +level 0. +.It Li usr +Configure the PMC to count events occurring at privilege levels 1, 2 +or 3. +.El +.Pp +If neither of the +.Dq Li os +or +.Dq Li usr +qualifiers are specified, the default is to enable both. +.Ss Event Specifiers (Programmable PMCs) +Haswell programmable PMCs support the following events: +.Bl -tag -width indent +.It Li LD_BLOCKS.STORE_FORWARD +.Pq Event 03H , Umask 02H +Loads blocked by overlapping with store buffer that +cannot be forwarded. +.It Li MISALIGN_MEM_REF.LOADS +.Pq Event 05H , Umask 01H +Speculative cache-line split load uops dispatched to +L1D. +.It Li MISALIGN_MEM_REF.STORES +.Pq Event 05H , Umask 02H +Speculative cache-line split Store-address uops +dispatched to L1D. +.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS +.Pq Event 07H , Umask 01H +False dependencies in MOB due to partial compare +on address. +.It Li DTLB_LOAD_MISSES.MISS_CAUSES_A_WALK +.Pq Event 08H , Umask 01H +Misses in all TLB levels that cause a page walk of any +page size. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_4K +.Pq Event 08H , Umask 02H +Completed page walks due to demand load misses +that caused 4K page walks in any TLB levels. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED_2M_4K +.Pq Event 08H , Umask 02H +Completed page walks due to demand load misses +that caused 2M/4M page walks in any TLB levels. +.It Li DTLB_LOAD_MISSES.WALK_COMPLETED +.Pq Event 08H , Umask 0EH +Completed page walks in any TLB of any page size +due to demand load misses +.It Li DTLB_LOAD_MISSES.WALK_DURATION +.Pq Event 08H , Umask 10H +Cycle PMH is busy with a walk. +.It Li DTLB_LOAD_MISSES.STLB_HIT_4K +.Pq Event 08H , Umask 20H +Load misses that missed DTLB but hit STLB (4K). +.It Li DTLB_LOAD_MISSES.STLB_HIT_2M +.Pq Event 08H , Umask 40H +Load misses that missed DTLB but hit STLB (2M). +.It Li DTLB_LOAD_MISSES.STLB_HIT +.Pq Event 08H , Umask 60H +Number of cache load STLB hits. No page walk. +.It Li DTLB_LOAD_MISSES.PDE_CACHE_MISS +.Pq Event 08H , Umask 80H +DTLB demand load misses with low part of linear-to- +physical address translation missed +.It Li INT_MISC.RECOVERY_CYCLES +.Pq Event 0DH , Umask 03H +Cycles waiting to recover after Machine Clears +except JEClear. Set Cmask= 1. +.It Li UOPS_ISSUED.ANY +.Pq Event 0EH , Umask 01H +ncrements each cycle the # of Uops issued by the +RAT to RS. +Set Cmask = 1, Inv = 1, Any= 1to count stalled cycles +of this core. +.It Li UOPS_ISSUED.FLAGS_MERGE +.Pq Event 0EH , Umask 10H +Number of flags-merge uops allocated. Such uops +adds delay. +.It Li UOPS_ISSUED.SLOW_LEA +.Pq Event 0EH , Umask 20H +Number of slow LEA or similar uops allocated. Such +uop has 3 sources (e.g. 2 sources + immediate) +regardless if as a result of LEA instruction or not. +.It Li UOPS_ISSUED.SiNGLE_MUL +.Pq Event 0EH , Umask 40H +Number of multiply packed/scalar single precision +uops allocated. +.It Li L2_RQSTS.DEMAND_DATA_RD_MISS +.Pq Event 24H , Umask 21H +Demand Data Read requests that missed L2, no +rejects. +.It Li L2_RQSTS.DEMAND_DATA_RD_HIT +.Pq Event 24H , Umask 41H +Demand Data Read requests that hit L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_DATA_RD +.Pq Event 24H , Umask E1H +Counts any demand and L1 HW prefetch data load +requests to L2. +.It Li L2_RQSTS.RFO_HIT +.Pq Event 24H , Umask 42H +Counts the number of store RFO requests that hit +the L2 cache. +.It Li L2_RQSTS.RFO_MISS +.Pq Event 24H , Umask 22H +Counts the number of store RFO requests that miss +the L2 cache. +.It Li L2_RQSTS.ALL_RFO +.Pq Event 24H , Umask E2H +Counts all L2 store RFO requests. +.It Li L2_RQSTS.CODE_RD_HIT +.Pq Event 24H , Umask 44H +Number of instruction fetches that hit the L2 cache. +.It Li L2_RQSTS.CODE_RD_MISS +.Pq Event 24H , Umask 24H +Number of instruction fetches that missed the L2 +cache. +.It Li L2_RQSTS.ALL_DEMAND_MISS +.Pq Event 24H , Umask 27H +Demand requests that miss L2 cache. +.It Li L2_RQSTS.ALL_DEMAND_REFERENCES +.Pq Event 24H , Umask E7H +Demand requests to L2 cache. +.It Li L2_RQSTS.ALL_CODE_RD +.Pq Event 24H , Umask E4H +Counts all L2 code requests. +.It Li L2_RQSTS.L2_PF_HIT +.Pq Event 24H , Umask 50H +Counts all L2 HW prefetcher requests that hit L2. +.It Li L2_RQSTS.L2_PF_MISS +.Pq Event 24H , Umask 30H +Counts all L2 HW prefetcher requests that missed +L2. +.It Li L2_RQSTS.ALL_PF +.Pq Event 24H , Umask F8H +Counts all L2 HW prefetcher requests. +.It Li L2_RQSTS.MISS +.Pq Event 24H , Umask 3FH +All requests that missed L2. +.It Li L2_RQSTS.REFERENCES +.Pq Event 24H , Umask FFH +All requests to L2 cache. +.It Li L2_DEMAND_RQSTS.WB_HIT +.Pq Event 27H , Umask 50H +Not rejected writebacks that hit L2 cache +.It Li LONGEST_LAT_CACHE.REFERENCE +.Pq Event 2EH , Umask 4FH +This event counts requests originating from the core +that reference a cache line in the last level cache. +.It Li LONGEST_LAT_CACHE.MISS +.Pq Event 2EH , Umask 41H +This event counts each cache miss condition for +references to the last level cache. +.It Li CPU_CLK_UNHALTED.THREAD_P +.Pq Event 3CH , Umask 00H +Counts the number of thread cycles while the thread +is not in a halt state. The thread enters the halt state +when it is running the HLT instruction. The core +frequency may change from time to time due to +power or thermal throttling. +.It Li CPU_CLK_THREAD_UNHALTED.REF_XCLK +.Pq Event 3CH , Umask 01H +Increments at the frequency of XCLK (100 MHz) +when not halted. +.It Li L1D_PEND_MISS.PENDING +.Pq Event 48H , Umask 01H +Increments the number of outstanding L1D misses +every cycle. Set Cmaks = 1 and Edge =1 to count +occurrences. +.It Li DTLB_STORE_MISSES.MISS_CAUSES_A_WALK +.Pq Event 49H , Umask 01H +Miss in all TLB levels causes an page walk of any +page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_COMPLETED_4K +.Pq Event 49H , Umask 02H +Completed page walks due to store misses in one or +more TLB levels of 4K page structure. +.It Li DTLB_STORE_MISSES.WALK_COMPLETED_2M_4M +.Pq Event 49H , Umask 04H +Completed page walks due to store misses in one or +more TLB levels of 2M/4M page structure. +.It Li DTLB_STORE_MISSES.WALK_COMPLETED +.Pq Event 49H , Umask 0EH +Completed page walks due to store miss in any TLB +levels of any page size (4K/2M/4M/1G). +.It Li DTLB_STORE_MISSES.WALK_DURATION +.Pq Event 49H , Umask 10H +Cycles PMH is busy with this walk. +.It Li DTLB_STORE_MISSES.STLB_HIT_4K +.Pq Event 49H , Umask 20H +Store misses that missed DTLB but hit STLB (4K). +.It Li DTLB_STORE_MISSES.STLB_HIT_2M +.Pq Event 49H , Umask 40H +Store misses that missed DTLB but hit STLB (2M). +.It Li DTLB_STORE_MISSES.STLB_HIT +.Pq Event 49H , Umask 60H +Store operations that miss the first TLB level but hit +the second and do not cause page walks. +.It Li DTLB_STORE_MISSES.PDE_CACHE_MISS +.Pq Event 49H , Umask 80H +DTLB store misses with low part of linear-to-physical +address translation missed. +.It Li LOAD_HIT_PRE.SW_PF +.Pq Event 4CH , Umask 01H +Non-SW-prefetch load dispatches that hit fill buffer +allocated for S/W prefetch. +.It Li LOAD_HIT_PRE.HW_PF +.Pq Event 4CH , Umask 02H +Non-SW-prefetch load dispatches that hit fill buffer +allocated for H/W prefetch. +.It Li L1D.REPLACEMENT +.Pq Event 51H , Umask 01H +Counts the number of lines brought into the L1 data +cache. +.It Li MOVE_ELIMINATION.INT_NOT_ELIMINATED +.Pq Event 58H , Umask 04H +Number of integer Move Elimination candidate uops +that were not eliminated. +.It Li MOVE_ELIMINATION.SMID_NOT_ELIMINATED +.Pq Event 58H , Umask 08H +Number of SIMD Move Elimination candidate uops +that were not eliminated. +.It Li MOVE_ELIMINATION.INT_ELIMINATED +.Pq Event 58H , Umask 01H +Unhalted core cycles when the thread is in ring 0. +.It Li MOVE_ELIMINATION.SMID_ELIMINATED +.Pq Event 58H , Umask 02H +Number of SIMD Move Elimination candidate uops +that were eliminated. +.It Li CPL_CYCLES.RING0 +.Pq Event 5CH , Umask 02H +Unhalted core cycles when the thread is in ring 0. +.It Li CPL_CYCLES.RING123 +.Pq Event 5CH , Umask 01H +Unhalted core cycles when the thread is not in ring 0. +.It Li RS_EVENTS.EMPTY_CYCLES +.Pq Event 5EH , Umask 01H +Cycles the RS is empty for the thread. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_DATA_RD +.Pq Event 60H , Umask 01H +Offcore outstanding Demand Data Read transactions +in SQ to uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_CORE_RD +.Pq Event 60H , Umask 02H +Offcore outstanding Demand code Read transactions +in SQ to uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND_RFO +.Pq Event 60H , Umask 04H +Offcore outstanding RFO store transactions in SQ to +uncore. Set Cmask=1 to count cycles. +.It Li OFFCORE_REQUESTS_OUTSTANDING.ALL_DATA_RD +.Pq Event 60H , Umask 08H +Offcore outstanding cacheable data read +transactions in SQ to uncore. Set Cmask=1 to count +cycles. +.It Li LOCK_CYCLES.SPLIT_LOCK_UC_LOCK_DURATION +.Pq Event 63H , Umask 01H +Cycles in which the L1D and L2 are locked, due to a +UC lock or split lock. +.It Li LOCK_CYCLES.CACHE_LOCK_DURATION +.Pq Event 63H , Umask 02H +Cycles in which the L1D is locked. +.It Li IDQ.EMPTY +.Pq Event 79H , Umask 02H +Counts cycles the IDQ is empty. +.It Li IDQ.MITE_UOPS +.Pq Event 79H , Umask 04H +Increment each cycle # of uops delivered to IDQ from +MITE path. +Set Cmask = 1 to count cycles. +.It Li IDQ.DSB_UOPS +.Pq Event 79H , Umask 08H +Increment each cycle. # of uops delivered to IDQ +from DSB path. +Set Cmask = 1 to count cycles. +.It Li IDQ.MS_DSB_UOPS +.Pq Event 79H , Umask 10H +Increment each cycle # of uops delivered to IDQ +when MS_busy by DSB. Set Cmask = 1 to count +cycles. Add Edge=1 to count # of delivery. +.It Li IDQ.MS_MITE_UOPS +.Pq Event 79H , Umask 20H +ncrement each cycle # of uops delivered to IDQ +when MS_busy by MITE. Set Cmask = 1 to count +cycles. +.It Li IDQ.MS_UOPS +.Pq Event 79H , Umask 30H +Increment each cycle # of uops delivered to IDQ from +MS by either DSB or MITE. Set Cmask = 1 to count +cycles. +.It Li IDQ.ALL_DSB_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered at least one uops. Set +Cmask = 1. +.It Li IDQ.ALL_DSB_CYCLES_4_UOPS +.Pq Event 79H , Umask 18H +Counts cycles DSB is delivered four uops. Set Cmask +=4. +.It Li IDQ.ALL_MITE_CYCLES_ANY_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered at least one uops. Set +Cmask = 1. +.It Li IDQ.ALL_MITE_CYCLES_4_UOPS +.Pq Event 79H , Umask 24H +Counts cycles MITE is delivered four uops. Set Cmask +=4. +.It Li IDQ.MITE_ALL_UOPS +.Pq Event 79H , Umask 3CH +# of uops delivered to IDQ from any path. +.It Li ICACHE.MISSES +.Pq Event 80H , Umask 02H +Number of Instruction Cache, Streaming Buffer and +Victim Cache Misses. Includes UC accesses. +.It Li ITLB_MISSES.MISS_CAUSES_A_WALK +.Pq Event 85H , Umask 01H +Misses in ITLB that causes a page walk of any page +size. +.It Li ITLB_MISSES.WALK_COMPLETED_4K +.Pq Event 85H , Umask 02H +Completed page walks due to misses in ITLB 4K page +entries. +.It Li TLB_MISSES.WALK_COMPLETED_2M_4M +.Pq Event 85H , Umask 04H +Completed page walks due to misses in ITLB 2M/4M +page entries. +.It Li ITLB_MISSES.WALK_COMPLETED +.Pq Event 85H , Umask 0EH +Completed page walks in ITLB of any page size. +.It Li ITLB_MISSES.WALK_DURATION +.Pq Event 85H , Umask 10H +Cycle PMH is busy with a walk. +.It Li ITLB_MISSES.STLB_HIT_4K +.Pq Event 85H , Umask 20H +ITLB misses that hit STLB (4K). +.It Li ITLB_MISSES.STLB_HIT_2M +.Pq Event 85H , Umask 40H +ITLB misses that hit STLB (2K). +.It Li ITLB_MISSES.STLB_HIT +.Pq Event 85H , Umask 60H +TLB misses that hit STLB. No page walk. +.It Li ILD_STALL.LCP +.Pq Event 87H , Umask 01H +Stalls caused by changing prefix length of the +instruction. +.It Li ILD_STALL.IQ_FULL +.Pq Event 87H , Umask 04H +Stall cycles due to IQ is full. +.It Li BR_INST_EXEC.COND +.Pq Event 88H , Umask 01H +Qualify conditional near branch instructions +executed, but not necessarily retired. +.It Li BR_INST_EXEC.DIRECT_JMP +.Pq Event 88H , Umask 02H +Qualify all unconditional near branch instructions +excluding calls and indirect branches. +.It Li BR_INST_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 88H , Umask 04H +Qualify executed indirect near branch instructions +that are not calls nor returns. +.It Li BR_INST_EXEC.RETURN_NEAR +.Pq Event 88H , Umask 08H +Qualify indirect near branches that have a return +mnemonic. +.It Li BR_INST_EXEC.DIRECT_NEAR_CALL +.Pq Event 88H , Umask 10H +Qualify unconditional near call branch instructions, +excluding non call branch, executed. +.It Li BR_INST_EXEC.INDIRECT_NEAR_CALL +.Pq Event 88H , Umask 20H +Qualify indirect near calls, including both register and +memory indirect, executed. +.It Li BR_INST_EXEC.NONTAKEN +.Pq Event 88H , Umask 40H +Qualify non-taken near branches executed. +.It Li BR_INST_EXEC.TAKEN +.Pq Event 88H , Umask 80H +Qualify taken near branches executed. Must combine +with 01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_INST_EXEC.ALL_BRANCHES +.Pq Event 88H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li BR_MISP_EXEC.COND +.Pq Event 89H , Umask 01H +Qualify conditional near branch instructions +mispredicted. +.It Li BR_MISP_EXEC.INDIRECT_JMP_NON_CALL_RET +.Pq Event 89H , Umask 04H +Qualify mispredicted indirect near branch +instructions that are not calls nor returns. +.It Li BR_MISP_EXEC.RETURN_NEAR +.Pq Event 89H , Umask 08H +Qualify mispredicted indirect near branches that +have a return mnemonic. +.It Li BR_MISP_EXEC.DIRECT_NEAR_CALL +.Pq Event 89H , Umask 10H +Qualify mispredicted unconditional near call branch +instructions, excluding non call branch, executed. +.It Li BR_MISP_EXEC.INDIRECT_NEAR_CALL +.Pq Event 89H , Umask 20H +Qualify mispredicted indirect near calls, including +both register and memory indirect, executed. +.It Li BR_MISP_EXEC.NONTAKEN +.Pq Event 89H , Umask 40H +Qualify mispredicted non-taken near branches +executed. +.It Li BR_MISP_EXEC.TAKEN +.Pq Event 89H , Umask 80H +Qualify mispredicted taken near branches executed. +Must combine with 01H,02H, 04H, 08H, 10H, 20H. +.It Li BR_MISP_EXEC.ALL_BRANCHES +.Pq Event 89H , Umask FFH +Counts all near executed branches (not necessarily +retired). +.It Li IDQ_UOPS_NOT_DELIVERED.CORE +.Pq Event 9CH , Umask 01H +Count number of non-delivered uops to RAT per +thread. +.It Li UOPS_EXECUTED_PORT.PORT_0 +.Pq Event A1H , Umask 01H +Cycles which a Uop is dispatched on port 0 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_1 +.Pq Event A1H , Umask 02H +Cycles which a Uop is dispatched on port 1 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_2 +.Pq Event A1H , Umask 04H +Cycles which a Uop is dispatched on port 2 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_3 +.Pq Event A1H , Umask 08H +Cycles which a Uop is dispatched on port 3 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_4 +.Pq Event A1H , Umask 10H +Cycles which a Uop is dispatched on port 4 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_5 +.Pq Event A1H , Umask 20H +Cycles which a Uop is dispatched on port 5 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_6 +.Pq Event A1H , Umask 40H +Cycles which a Uop is dispatched on port 6 in this +thread. +.It Li UOPS_EXECUTED_PORT.PORT_7 +.Pq Event A1H , Umask 80H +Cycles which a Uop is dispatched on port 7 in this +thread. +.It Li RESOURCE_STALLS.ANY +.Pq Event A2H , Umask 01H +Cycles Allocation is stalled due to Resource Related +reason. +.It Li RESOURCE_STALLS.RS +.Pq Event A2H , Umask 04H +Cycles stalled due to no eligible RS entry available. +.It Li RESOURCE_STALLS.SB +.Pq Event A2H , Umask 08H +Cycles stalled due to no store buffers available (not +including draining form sync). +.It Li RESOURCE_STALLS.ROB +.Pq Event A2H , Umask 10H +Cycles stalled due to re-order buffer full. +.It Li CYCLE_ACTIVITY.CYCLES_L2_PENDING +.Pq Event A3H , Umask 01H +Cycles with pending L2 miss loads. Set Cmask=2 to +count cycle. +.It Li CYCLE_ACTIVITY.CYCLES_LDM_PENDING +.Pq Event A3H , Umask 02H +Cycles with pending memory loads. Set Cmask=2 to +count cycle. +.It Li CYCLE_ACTIVITY.STALLS_L2_PENDING +.Pq Event A3H , Umask 05H +Number of loads missed L2. +.It Li CYCLE_ACTIVITY.CYCLES_L1D_PENDING +.Pq Event A3H , Umask 08H +Cycles with pending L1 cache miss loads. Set +Cmask=8 to count cycle. +.It Li ITLB.ITLB_FLUSH +.Pq Event AEH , Umask 01H +Counts the number of ITLB flushes, includes +4k/2M/4M pages. +.It Li OFFCORE_REQUESTS.DEMAND_DATA_RD +.Pq Event B0H , Umask 01H +Demand data read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_CODE_RD +.Pq Event B0H , Umask 02H +Demand code read requests sent to uncore. +.It Li OFFCORE_REQUESTS.DEMAND_RFO +.Pq Event B0H , Umask 04H +Demand RFO read requests sent to uncore, including +regular RFOs, locks, ItoM. +.It Li OFFCORE_REQUESTS.ALL_DATA_RD +.Pq Event B0H , Umask 08H +Data read requests sent to uncore (demand and +prefetch). +.It Li UOPS_EXECUTED.CORE +.Pq Event B1H , Umask 02H +Counts total number of uops to be executed per-core +each cycle. +.It Li OFF_CORE_RESPONSE_0 +.Pq Event B7H , Umask 01H +Requires MSR 01A6H +.It Li OFF_CORE_RESPONSE_1 +.Pq Event BBH , Umask 01H +Requires MSR 01A7H +.It Li PAGE_WALKER_LOADS.DTLB_L1 +.Pq Event BCH , Umask 11H +Number of DTLB page walker loads that hit in the +L1+FB. +.It Li PAGE_WALKER_LOADS.ITLB_L1 +.Pq Event BCH , Umask 21H +Number of ITLB page walker loads that hit in the +L1+FB. +.It Li PAGE_WALKER_LOADS.DTLB_L2 +.Pq Event BCH , Umask 12H +Number of DTLB page walker loads that hit in the L2. +.It Li PAGE_WALKER_LOADS.ITLB_L2 +.Pq Event BCH , Umask 22H +Number of ITLB page walker loads that hit in the L2. +.It Li PAGE_WALKER_LOADS.DTLB_L3 +.Pq Event BCH , Umask 14H +Number of DTLB page walker loads that hit in the L3. +.It Li PAGE_WALKER_LOADS.ITLB_L3 +.Pq Event BCH , Umask 24H +Number of ITLB page walker loads that hit in the L3. +.It Li PAGE_WALKER_LOADS.DTLB_MEMORY +.Pq Event BCH , Umask 18H +Number of DTLB page walker loads from memory. +.It Li PAGE_WALKER_LOADS.ITLB_MEMORY +.Pq Event BCH , Umask 28H +Number of ITLB page walker loads from memory. +.It Li TLB_FLUSH.DTLB_THREAD +.Pq Event BDH , Umask 01H +DTLB flush attempts of the thread-specific entries. +.It Li TLB_FLUSH.STLB_ANY +.Pq Event BDH , Umask 20H +Count number of STLB flush attempts. +.It Li INST_RETIRED.ANY_P +.Pq Event C0H , Umask 00H +Number of instructions at retirement. +.It Li INST_RETIRED.ALL +.Pq Event C0H , Umask 01H +Precise instruction retired event with HW to reduce +effect of PEBS shadow in IP distribution. +.It Li OTHER_ASSISTS.AVX_TO_SSE +.Pq Event C1H , Umask 08H +Number of transitions from AVX-256 to legacy SSE +when penalty applicable. +.It Li OTHER_ASSISTS.SSE_TO_AVX +.Pq Event C1H , Umask 10H +Number of transitions from SSE to AVX-256 when +penalty applicable. +.It Li OTHER_ASSISTS.ANY_WB_ASSIST +.Pq Event C1H , Umask 40H +Number of microcode assists invoked by HW upon +uop writeback. +.It Li UOPS_RETIRED.ALL +.Pq Event C2H , Umask 01H +Counts the number of micro-ops retired, Use +cmask=1 and invert to count active cycles or stalled +cycles. +.It Li UOPS_RETIRED.RETIRE_SLOTS +.Pq Event C2H , Umask 02H +Counts the number of retirement slots used each +cycle. +.It Li MACHINE_CLEARS.MEMORY_ORDERING +.Pq Event C3H , Umask 02H +Counts the number of machine clears due to memory +order conflicts. +.It Li MACHINE_CLEARS.SMC +.Pq Event C3H , Umask 04H +Number of self-modifying-code machine clears +detected. +.It Li MACHINE_CLEARS.MASKMOV +.Pq Event C3H , Umask 20H +Counts the number of executed AVX masked load +operations that refer to an illegal address range with +the mask bits set to 0. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 00H +Branch instructions at retirement. +.It Li BR_INST_RETIRED.CONDITIONAL +.Pq Event C4H , Umask 01H +Counts the number of conditional branch instructions Supports PEBS +retired. +.It Li BR_INST_RETIRED.NEAR_CALL +.Pq Event C4H , Umask 02H +Direct and indirect near call instructions retired. +.It Li BR_INST_RETIRED.ALL_BRANCHES +.Pq Event C4H , Umask 04H +Counts the number of branch instructions retired. +.It Li BR_INST_RETIRED.NEAR_RETURN +.Pq Event C4H , Umask 08H +Counts the number of near return instructions +retired. +.It Li BR_INST_RETIRED.NOT_TAKEN +.Pq Event C4H , Umask 10H +Counts the number of not taken branch instructions +retired. + It Li BR_INST_RETIRED.NEAR_TAKEN +.Pq Event C4H , Umask 20H +Number of near taken branches retired. +.It Li BR_INST_RETIRED.FAR_BRANCH +.Pq Event C4H , Umask 40H +Number of far branches retired. +.It Li BR_MISP_RETIRED.ALL_BRANCHES +.Pq Event C5H , Umask 00H +Mispredicted branch instructions at retirement +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 01H +Mispredicted conditional branch instructions retired. +.It Li BR_MISP_RETIRED.CONDITIONAL +.Pq Event C5H , Umask 04H +Mispredicted macro branch instructions retired. +.It Li FP_ASSIST.X87_OUTPUT +.Pq Event CAH , Umask 02H +Number of X87 FP assists due to Output values. +.It Li FP_ASSIST.X87_INPUT +.Pq Event CAH , Umask 04H +Number of X87 FP assists due to input values. +.It Li FP_ASSIST.SIMD_OUTPUT +.Pq Event CAH , Umask 08H +Number of SIMD FP assists due to Output values. +.It Li FP_ASSIST.SIMD_INPUT +.Pq Event CAH , Umask 10H +Number of SIMD FP assists due to input values. +.It Li FP_ASSIST.ANY +.Pq Event CAH , Umask 1EH +Cycles with any input/output SSE* or FP assists. +.It Li ROB_MISC_EVENTS.LBR_INSERTS +.Pq Event CCH , Umask 20H +Count cases of saving new LBR records by hardware. +.It Li MEM_TRANS_RETIRED.LOAD_LATENCY +.Pq Event CDH , Umask 01H +Randomly sampled loads whose latency is above a +user defined threshold. A small fraction of the overall +loads are sampled due to randomization. +.It Li MEM_UOP_RETIRED.LOADS +.Pq Event D0H , Umask 01H +Qualify retired memory uops that are loads. Combine Supports PEBS and +with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STORES +.Pq Event D0H , Umask 02H +Qualify retired memory uops that are stores. +Combine with umask 10H, 20H, 40H, 80H. +.It Li MEM_UOP_RETIRED.STLB_MISS +.Pq Event D0H , Umask 10H +Qualify retired memory uops with STLB miss. Must +combine with umask 01H, 02H, to produce counts. +.It Li MEM_UOP_RETIRED.LOCK +.Pq Event D0H , Umask 20H +Qualify retired memory uops with lock. Must combine Supports PEBS and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-9@FreeBSD.ORG Fri Apr 19 21:09:27 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF181D3A; Fri, 19 Apr 2013 21:09:27 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 979821ECA; Fri, 19 Apr 2013 21:09:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3JL9RcZ019340; Fri, 19 Apr 2013 21:09:27 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3JL9RXI019339; Fri, 19 Apr 2013 21:09:27 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201304192109.r3JL9RXI019339@svn.freebsd.org> From: "Kenneth D. Merry" Date: Fri, 19 Apr 2013 21:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249661 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Apr 2013 21:09:27 -0000 Author: ken Date: Fri Apr 19 21:09:27 2013 New Revision: 249661 URL: http://svnweb.freebsd.org/changeset/base/249661 Log: MFC r249347: ------------------------------------------------------------------------ r249347 | ken | 2013-04-10 16:12:21 -0600 (Wed, 10 Apr 2013) | 22 lines Add a callback to the ada(4) driver so that it knows when GEOM has released references to it. This is the functional equivalent to change r237518, which added this functionality to the cd(4) and da(4) drivers. This fix prevents a panic caused by GEOM calling adaopen() while the device is going away. We now keep the device around until GEOM has finished cleaning up its state. ata_da.c: In adaregister(), add a d_gone callback to the GEOM disk structure registered for the ada driver. Increment the peripheral reference count for GEOM. Add a new callback, adadiskgonecb(), that GEOM calls when it is done with its resources. This callback releases the reference acquired in adaregister(). Submitted by: Po-Li Soong Sponsored by: Spectra Logic Modified: stable/9/sys/cam/ata/ata_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Fri Apr 19 21:08:56 2013 (r249660) +++ stable/9/sys/cam/ata/ata_da.c Fri Apr 19 21:09:27 2013 (r249661) @@ -792,6 +792,20 @@ adainit(void) } } +/* + * Callback from GEOM, called when it has finished cleaning up its + * resources. + */ +static void +adadiskgonecb(struct disk *dp) +{ + struct cam_periph *periph; + + periph = (struct cam_periph *)dp->d_drv1; + + cam_periph_release(periph); +} + static void adaoninvalidate(struct cam_periph *periph) { @@ -1131,6 +1145,7 @@ adaregister(struct cam_periph *periph, v softc->disk->d_strategy = adastrategy; softc->disk->d_getattr = adagetattr; softc->disk->d_dump = adadump; + softc->disk->d_gone = adadiskgonecb; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; maxio = cpi.maxio; /* Honor max I/O size of SIM */ @@ -1194,6 +1209,17 @@ adaregister(struct cam_periph *periph, v } } else legacy_id = -1; + /* + * Acquire a reference to the periph before we register with GEOM. + * We'll release this reference once GEOM calls us back (via + * adadiskgonecb()) telling us that our provider has been freed. + */ + if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: lost periph during " + "registration!\n", __func__); + cam_periph_lock(periph); + return (CAM_REQ_CMP_ERR); + } disk_create(softc->disk, DISK_VERSION); cam_periph_lock(periph); cam_periph_unhold(periph); From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 20 09:25:25 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AC4AA709; Sat, 20 Apr 2013 09:25:25 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5E3146E; Sat, 20 Apr 2013 09:25:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3K9PP1P001394; Sat, 20 Apr 2013 09:25:25 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3K9PPb9001392; Sat, 20 Apr 2013 09:25:25 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304200925.r3K9PPb9001392@svn.freebsd.org> From: Martin Matuska Date: Sat, 20 Apr 2013 09:25:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249689 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 09:25:25 -0000 Author: mm Date: Sat Apr 20 09:25:25 2013 New Revision: 249689 URL: http://svnweb.freebsd.org/changeset/base/249689 Log: MFC r249047 (avg): spa_open_common: fix argument to zvol_create_minors Prior to r248571 spa_open was always called with a bare pool name, but now it is called with a dataset name instead (spa_lookup handles that). So, when a ZFS root is mounted spa_open is called with a name of a root dataset, which can very well be different from the pool name. But zvol_create_minors should be called with the pool name, because it performs a recursive traversal of all datasets under the name to find all those that are volumes. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Apr 20 08:25:14 2013 (r249688) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Apr 20 09:25:25 2013 (r249689) @@ -2870,7 +2870,7 @@ spa_open_common(const char *pool, spa_t #ifdef __FreeBSD__ #ifdef _KERNEL if (firstopen) - zvol_create_minors(pool); + zvol_create_minors(spa->spa_name); #endif #endif } From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 20 11:46:39 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C7703C50; Sat, 20 Apr 2013 11:46:39 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B976A1876; Sat, 20 Apr 2013 11:46:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KBkdRM059926; Sat, 20 Apr 2013 11:46:39 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KBkcsl059909; Sat, 20 Apr 2013 11:46:38 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201304201146.r3KBkcsl059909@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 20 Apr 2013 11:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249696 - stable/9/contrib/tzdata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 11:46:39 -0000 Author: edwin Date: Sat Apr 20 11:46:38 2013 New Revision: 249696 URL: http://svnweb.freebsd.org/changeset/base/249696 Log: Merge of current from 249692, tzdata2013c: - antarctica: AusAQ and ATAQ have been removed. - Antarctica/Macquarie has been moved to australasia file and AU. - Asia/Hebron, Palestine updated for 2013. - Paraguay stays with DST for the whole year. Modified: stable/9/contrib/tzdata/antarctica stable/9/contrib/tzdata/asia stable/9/contrib/tzdata/australasia stable/9/contrib/tzdata/southamerica stable/9/contrib/tzdata/zone.tab Directory Properties: stable/9/contrib/tzdata/ (props changed) Modified: stable/9/contrib/tzdata/antarctica ============================================================================== --- stable/9/contrib/tzdata/antarctica Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/antarctica Sat Apr 20 11:46:38 2013 (r249696) @@ -53,34 +53,6 @@ Rule ChileAQ 2011 only - Aug Sun>=16 4:0 Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 - Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S -# These rules are stolen from the `australasia' file. -Rule AusAQ 1917 only - Jan 1 0:01 1:00 - -Rule AusAQ 1917 only - Mar 25 2:00 0 - -Rule AusAQ 1942 only - Jan 1 2:00 1:00 - -Rule AusAQ 1942 only - Mar 29 2:00 0 - -Rule AusAQ 1942 only - Sep 27 2:00 1:00 - -Rule AusAQ 1943 1944 - Mar lastSun 2:00 0 - -Rule AusAQ 1943 only - Oct 3 2:00 1:00 - -Rule ATAQ 1967 only - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1968 only - Mar lastSun 2:00s 0 - -Rule ATAQ 1968 1985 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1969 1971 - Mar Sun>=8 2:00s 0 - -Rule ATAQ 1972 only - Feb lastSun 2:00s 0 - -Rule ATAQ 1973 1981 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1982 1983 - Mar lastSun 2:00s 0 - -Rule ATAQ 1984 1986 - Mar Sun>=1 2:00s 0 - -Rule ATAQ 1986 only - Oct Sun>=15 2:00s 1:00 - -Rule ATAQ 1987 1990 - Mar Sun>=15 2:00s 0 - -Rule ATAQ 1987 only - Oct Sun>=22 2:00s 1:00 - -Rule ATAQ 1988 1990 - Oct lastSun 2:00s 1:00 - -Rule ATAQ 1991 1999 - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 1991 2005 - Mar lastSun 2:00s 0 - -Rule ATAQ 2000 only - Aug lastSun 2:00s 1:00 - -Rule ATAQ 2001 max - Oct Sun>=1 2:00s 1:00 - -Rule ATAQ 2006 only - Apr Sun>=1 2:00s 0 - -Rule ATAQ 2007 only - Mar lastSun 2:00s 0 - -Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 - - # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 # Esperanza, San Martin Land, -6323-05659, since 1952-12-17 @@ -122,10 +94,7 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # From Steffen Thorsen (2010-03-10): -# We got these changes from the Australian Antarctic Division: -# - Macquarie Island will stay on UTC+11 for winter and therefore not -# switch back from daylight savings time when other parts of Australia do -# on 4 April. +# We got these changes from the Australian Antarctic Division: ... # # - Casey station reverted to its normal time of UTC+8 on 5 March 2010. # The change to UTC+11 is being considered as a regular summer thing but @@ -136,9 +105,6 @@ Rule ATAQ 2008 max - Apr Sun>=1 2:00s 0 # # - Mawson station stays on UTC+5. # -# In addition to the Rule changes for Casey/Davis, it means that Macquarie -# will no longer be like Hobart and will have to have its own Zone created. -# # Background: # # http://www.timeanddate.com/news/time/antartica-time-changes-2010.html @@ -165,12 +131,6 @@ Zone Antarctica/Mawson 0 - zzz 1954 Feb 6:00 - MAWT 2009 Oct 18 2:00 # Mawson Time 5:00 - MAWT -Zone Antarctica/Macquarie 0 - zzz 1911 - 10:00 - EST 1916 Oct 1 2:00 - 10:00 1:00 EST 1917 Feb - 10:00 AusAQ EST 1967 - 10:00 ATAQ EST 2010 Apr 4 3:00 - 11:00 - MIST # Macquarie Island Time # References: # # Casey Weather (1998-02-26) Modified: stable/9/contrib/tzdata/asia ============================================================================== --- stable/9/contrib/tzdata/asia Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/asia Sat Apr 20 11:46:38 2013 (r249696) @@ -2291,11 +2291,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.timeanddate.com/news/time/gaza-west-bank-dst-2012.html # -# From Arthur David Olson (2012-03-27): -# The timeanddate article for 2012 says that "the end date has not yet been -# announced" and that "Last year, both...paused daylight saving time during... -# Ramadan. It is not yet known [for] 2012." -# For now, assume both switch back on the last Friday in September. XXX +# From Steffen Thorsen (2013-03-26): +# The following news sources tells that Palestine will "start daylight saving +# time from midnight on Friday, March 29, 2013" (translated). +# [These are in Arabic and are for Gaza and for Ramallah, respectively.] +# http://www.samanews.com/index.php?act=Show&id=154120 +# http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html + +# From Paul Eggert (2013-04-15): +# For future dates, guess the last Thursday in March at 24:00 through +# the first Friday on or after September 21 at 01:00. This is consistent with +# the predictions in today's editions of the following URLs, +# which are for Gaza and Hebron respectively: +# http://www.timeanddate.com/worldclock/timezone.html?n=702 +# http://www.timeanddate.com/worldclock/timezone.html?n=2364 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S @@ -2309,19 +2318,20 @@ Rule Palestine 1999 2005 - Apr Fri>=15 0 Rule Palestine 1999 2003 - Oct Fri>=15 0:00 0 - Rule Palestine 2004 only - Oct 1 1:00 0 - Rule Palestine 2005 only - Oct 4 2:00 0 - -Rule Palestine 2006 2008 - Apr 1 0:00 1:00 S +Rule Palestine 2006 2007 - Apr 1 0:00 1:00 S Rule Palestine 2006 only - Sep 22 0:00 0 - Rule Palestine 2007 only - Sep Thu>=8 2:00 0 - -Rule Palestine 2008 only - Aug lastFri 0:00 0 - -Rule Palestine 2009 only - Mar lastFri 0:00 1:00 S -Rule Palestine 2009 only - Sep Fri>=1 2:00 0 - -Rule Palestine 2010 only - Mar lastSat 0:01 1:00 S +Rule Palestine 2008 2009 - Mar lastFri 0:00 1:00 S +Rule Palestine 2008 only - Sep 1 0:00 0 - +Rule Palestine 2009 only - Sep Fri>=1 1:00 0 - +Rule Palestine 2010 only - Mar 26 0:00 1:00 S Rule Palestine 2010 only - Aug 11 0:00 0 - - -# From Arthur David Olson (2011-09-20): -# 2011 transitions per http://www.timeanddate.com as of 2011-09-20. -# From Paul Eggert (2012-10-12): -# 2012 transitions per http://www.timeanddate.com as of 2012-10-12. +Rule Palestine 2011 only - Apr 1 0:01 1:00 S +Rule Palestine 2011 only - Aug 1 0:00 0 - +Rule Palestine 2011 only - Aug 30 0:00 1:00 S +Rule Palestine 2011 only - Sep 30 0:00 0 - +Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S +Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct @@ -2329,26 +2339,20 @@ Zone Asia/Gaza 2:17:52 - LMT 1900 Oct 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2011 Apr 2 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT 2008 Aug 29 0:00 + 2:00 - EET 2008 Sep + 2:00 Palestine EE%sT 2010 + 2:00 - EET 2010 Mar 27 0:01 + 2:00 Palestine EE%sT 2011 Aug 1 + 2:00 - EET 2012 + 2:00 Palestine EE%sT Zone Asia/Hebron 2:20:23 - LMT 1900 Oct 2:00 Zion EET 1948 May 15 2:00 EgyptAsia EE%sT 1967 Jun 5 2:00 Zion I%sT 1996 2:00 Jordan EE%sT 1999 - 2:00 Palestine EE%sT 2008 Aug - 2:00 1:00 EEST 2008 Sep - 2:00 Palestine EE%sT 2011 Apr 1 12:01 - 2:00 1:00 EEST 2011 Aug 1 - 2:00 - EET 2011 Aug 30 - 2:00 1:00 EEST 2011 Sep 30 3:00 - 2:00 - EET 2012 Mar 30 - 2:00 1:00 EEST 2012 Sep 21 1:00 - 2:00 - EET + 2:00 Palestine EE%sT # Paracel Is # no information Modified: stable/9/contrib/tzdata/australasia ============================================================================== --- stable/9/contrib/tzdata/australasia Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/australasia Sat Apr 20 11:46:38 2013 (r249696) @@ -218,9 +218,26 @@ Zone Australia/Lord_Howe 10:36:20 - LMT # no times are set # # Macquarie -# permanent occupation (scientific station) since 1948; -# sealing and penguin oil station operated 1888/1917 -# like Australia/Hobart +# Permanent occupation (scientific station) 1911-1915 and since 25 March 1948; +# sealing and penguin oil station operated Nov 1899 to Apr 1919. See the +# Tasmania Parks & Wildlife Service history of sealing at Macquarie Island +# +# . +# Guess that it was like Australia/Hobart while inhabited before 2010. +# +# From Steffen Thorsen (2010-03-10): +# We got these changes from the Australian Antarctic Division: +# - Macquarie Island will stay on UTC+11 for winter and therefore not +# switch back from daylight savings time when other parts of Australia do +# on 4 April. +Zone Antarctica/Macquarie 0 - zzz 1899 Nov + 10:00 - EST 1916 Oct 1 2:00 + 10:00 1:00 EST 1917 Feb + 10:00 Aus EST 1919 Apr + 0 - zzz 1948 Mar 25 + 10:00 Aus EST 1967 + 10:00 AT EST 2010 Apr 4 3:00 + 11:00 - MIST # Macquarie I Standard Time # Christmas # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: stable/9/contrib/tzdata/southamerica ============================================================================== --- stable/9/contrib/tzdata/southamerica Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/southamerica Sat Apr 20 11:46:38 2013 (r249696) @@ -1566,16 +1566,16 @@ Rule Para 2005 2009 - Mar Sun>=8 0:00 0 # forward 60 minutes, in all the territory of the Paraguayan Republic. # ... Rule Para 2010 max - Oct Sun>=1 0:00 1:00 S -Rule Para 2010 max - Apr Sun>=8 0:00 0 - +Rule Para 2010 2012 - Apr Sun>=8 0:00 0 - # # From Steffen Thorsen (2013-03-07): # Paraguay will end DST on 2013-03-24 00:00.... -# They do not tell if this will be a permanent change or just this year.... # http://www.ande.gov.py/interna.php?id=1075 # -# From Paul Eggert (2013-03-07): -# For now, assume it's just this year. -Rule Para 2013 only - Mar 24 0:00 0 - +# From Carlos Raul Perasso (2013-03-15): +# The change in Paraguay is now final. Decree number 10780 +# http://www.presidencia.gov.py/uploads/pdf/presidencia-3b86ff4b691c79d4f5927ca964922ec74772ce857c02ca054a52a37b49afc7fb.pdf +Rule Para 2013 max - Mar Sun>=22 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone America/Asuncion -3:50:40 - LMT 1890 Modified: stable/9/contrib/tzdata/zone.tab ============================================================================== --- stable/9/contrib/tzdata/zone.tab Sat Apr 20 11:46:01 2013 (r249695) +++ stable/9/contrib/tzdata/zone.tab Sat Apr 20 11:46:38 2013 (r249696) @@ -42,7 +42,6 @@ AQ -6617+11031 Antarctica/Casey Casey St AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I -AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island AR -3436-05827 America/Argentina/Buenos_Aires Buenos Aires (BA, CF) AR -3124-06411 America/Argentina/Cordoba most locations (CB, CC, CN, ER, FM, MN, SE, SF) AR -2447-06525 America/Argentina/Salta (SA, LP, NQ, RN) @@ -58,6 +57,7 @@ AR -5448-06818 America/Argentina/Ushuaia AS -1416-17042 Pacific/Pago_Pago AT +4813+01620 Europe/Vienna AU -3133+15905 Australia/Lord_Howe Lord Howe Island +AU -5430+15857 Antarctica/Macquarie Macquarie Island AU -4253+14719 Australia/Hobart Tasmania - most locations AU -3956+14352 Australia/Currie Tasmania - King Island AU -3749+14458 Australia/Melbourne Victoria From owner-svn-src-stable-9@FreeBSD.ORG Sat Apr 20 14:55:48 2013 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CECFA4B3; Sat, 20 Apr 2013 14:55:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C00A229; Sat, 20 Apr 2013 14:55:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3KEtmJP058894; Sat, 20 Apr 2013 14:55:48 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3KEtmAD058892; Sat, 20 Apr 2013 14:55:48 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201304201455.r3KEtmAD058892@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 20 Apr 2013 14:55:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r249703 - stable/9/gnu/lib/libstdc++ X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Apr 2013 14:55:48 -0000 Author: pfg Date: Sat Apr 20 14:55:48 2013 New Revision: 249703 URL: http://svnweb.freebsd.org/changeset/base/249703 Log: libstdc++: Revert the expl addition from r246857. When the needed configuration update to libstdc++ was done. we overlooked that expl hasn't been merged. This is causing breakage in some ports. Reported by: Diane Bruce Reviewed by: dim Modified: stable/9/gnu/lib/libstdc++/config.h Modified: stable/9/gnu/lib/libstdc++/config.h ============================================================================== --- stable/9/gnu/lib/libstdc++/config.h Sat Apr 20 14:44:28 2013 (r249702) +++ stable/9/gnu/lib/libstdc++/config.h Sat Apr 20 14:55:48 2013 (r249703) @@ -67,7 +67,7 @@ #define HAVE_EXPF 1 /* Define to 1 if you have the `expl' function. */ -#define HAVE_EXPL 1 +/* #undef HAVE_EXPL 1 */ /* Define to 1 if you have the `fabsf' function. */ #define HAVE_FABSF 1