From owner-p4-projects@FreeBSD.ORG Wed Nov 19 21:20:32 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id BAA8C1065675; Wed, 19 Nov 2008 21:20:32 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F23C106564A for ; Wed, 19 Nov 2008 21:20:32 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3DD8FC17 for ; Wed, 19 Nov 2008 21:20:32 +0000 (UTC) (envelope-from csjp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mAJLKWrC074688 for ; Wed, 19 Nov 2008 21:20:32 GMT (envelope-from csjp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mAJLKWLY074686 for perforce@freebsd.org; Wed, 19 Nov 2008 21:20:32 GMT (envelope-from csjp@freebsd.org) Date: Wed, 19 Nov 2008 21:20:32 GMT Message-Id: <200811192120.mAJLKWLY074686@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to csjp@freebsd.org using -f From: "Christian S.J. Peron" To: Perforce Change Reviews Cc: Subject: PERFORCE change 153241 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 21:20:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=153241 Change 153241 by csjp@hvm02 on 2008/11/19 21:19:33 - Fix a stack overflow which was the result of the drop/read counters being switched to 64 bits. - Don't bother trying to process the ap_truncates counter since this counter is no longer supported. Affected files ... .. //depot/projects/trustedbsd/bsmtrace/pipe.c#2 edit .. //depot/projects/trustedbsd/bsmtrace/pipe.h#2 edit Differences ... ==== //depot/projects/trustedbsd/bsmtrace/pipe.c#2 (text+ko) ==== @@ -32,7 +32,6 @@ #ifdef AUDITPIPE_GET_DROPS static int ap_cur_drop_cnt; -static int ap_cur_trunc_cnt; void pipe_analyze_loss(int pipefd) @@ -42,16 +41,6 @@ pipe_get_stats(pipefd, &aps); /* - * We dont currently handle truncated records, but we should at - * least be logging the fact that it happens. - */ - if (aps.ap_truncates > ap_cur_trunc_cnt) { - bsmtrace_error(0, "audit pipe truncated %d records" - " (%d) since last interval", aps.ap_truncates, - aps.ap_truncates - ap_cur_trunc_cnt); - ap_cur_trunc_cnt = aps.ap_truncates; - } - /* * If there has been no change in the drop count since the last time * we collected the statistics, return because there is nothing to * worry about. @@ -95,9 +84,6 @@ if (ioctl(pipefd, AUDITPIPE_GET_DROPS, &aps->ap_drops) < 0) bsmtrace_error(1, "AUDITPIPE_GET_DROPS: %s", strerror(errno)); - if (ioctl(pipefd, AUDITPIPE_GET_TRUNCATES, &aps->ap_truncates) < 0) - bsmtrace_error(1, "AUDITPIPE_GET_TRUNCATES: %s", - strerror(errno)); } void @@ -110,13 +96,12 @@ /* XXX should be calling bsmtrace_error(0, ...) here? */ if (opts.Fflag) (void) fprintf(stderr, - "audit record drops %u\n" - "audit record reads %u\n" - "audit record truncates %u\n", - aps.ap_drops, aps.ap_reads, aps.ap_truncates); + "audit record drops %ju\n" + "audit record reads %ju\n", + aps.ap_drops, aps.ap_reads); else syslog(LOG_AUTH | LOG_INFO, - "audit record drops=%u reads=%u truncates=%u", - aps.ap_drops, aps.ap_reads, aps.ap_truncates); + "audit record drops=%ju reads=%ju", + aps.ap_drops, aps.ap_reads); } #endif /* AUDITPIPE_GET_DROPS */ ==== //depot/projects/trustedbsd/bsmtrace/pipe.h#2 (text+ko) ==== @@ -31,9 +31,8 @@ #define PIPE_DOT_H_ struct pipe_stats { - unsigned int ap_reads; - unsigned int ap_drops; - unsigned int ap_truncates; + u_int64_t ap_reads; + u_int64_t ap_drops; }; void pipe_analyze_loss(int);