Deleted Added
full compact
pmclog.c (174215) pmclog.c (185363)
1/*-
2 * Copyright (c) 2005-2007 Joseph Koshy
3 * Copyright (c) 2007 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by A. Joseph Koshy under
7 * sponsorship from the FreeBSD Foundation and Google, Inc.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005-2007 Joseph Koshy
3 * Copyright (c) 2007 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by A. Joseph Koshy under
7 * sponsorship from the FreeBSD Foundation and Google, Inc.
8 *

--- 15 unchanged lines hidden (view full) ---

24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/lib/libpmc/pmclog.c 174215 2007-12-03 11:15:46Z jkoshy $");
32__FBSDID("$FreeBSD: head/lib/libpmc/pmclog.c 185363 2008-11-27 09:00:47Z jkoshy $");
33
34#include <sys/param.h>
35#include <sys/pmc.h>
36#include <sys/pmclog.h>
37
38#include <assert.h>
39#include <errno.h>
40#include <pmc.h>
41#include <pmclog.h>
42#include <stddef.h>
43#include <stdlib.h>
44#include <string.h>
45#include <strings.h>
46#include <unistd.h>
47
48#include <machine/pmc_mdep.h>
49
33
34#include <sys/param.h>
35#include <sys/pmc.h>
36#include <sys/pmclog.h>
37
38#include <assert.h>
39#include <errno.h>
40#include <pmc.h>
41#include <pmclog.h>
42#include <stddef.h>
43#include <stdlib.h>
44#include <string.h>
45#include <strings.h>
46#include <unistd.h>
47
48#include <machine/pmc_mdep.h>
49
50#include "libpmcinternal.h"
51
50#define PMCLOG_BUFFER_SIZE 4096
51
52/*
53 * API NOTES
54 *
55 * The pmclog(3) API is oriented towards parsing an event stream in
56 * "realtime", i.e., from an data source that may or may not preserve
57 * record boundaries -- for example when the data source is elsewhere

--- 300 unchanged lines hidden (view full) ---

358 PMCLOG_READ32(le,ev->pl_u.pl_s.pl_pmcid);
359 PMCLOG_READ32(le,ev->pl_u.pl_s.pl_usermode);
360 break;
361 case PMCLOG_TYPE_PMCALLOCATE:
362 PMCLOG_READ32(le,ev->pl_u.pl_a.pl_pmcid);
363 PMCLOG_READ32(le,ev->pl_u.pl_a.pl_event);
364 PMCLOG_READ32(le,ev->pl_u.pl_a.pl_flags);
365 if ((ev->pl_u.pl_a.pl_evname =
52#define PMCLOG_BUFFER_SIZE 4096
53
54/*
55 * API NOTES
56 *
57 * The pmclog(3) API is oriented towards parsing an event stream in
58 * "realtime", i.e., from an data source that may or may not preserve
59 * record boundaries -- for example when the data source is elsewhere

--- 300 unchanged lines hidden (view full) ---

360 PMCLOG_READ32(le,ev->pl_u.pl_s.pl_pmcid);
361 PMCLOG_READ32(le,ev->pl_u.pl_s.pl_usermode);
362 break;
363 case PMCLOG_TYPE_PMCALLOCATE:
364 PMCLOG_READ32(le,ev->pl_u.pl_a.pl_pmcid);
365 PMCLOG_READ32(le,ev->pl_u.pl_a.pl_event);
366 PMCLOG_READ32(le,ev->pl_u.pl_a.pl_flags);
367 if ((ev->pl_u.pl_a.pl_evname =
366 pmc_name_of_event(ev->pl_u.pl_a.pl_event)) == NULL)
368 _pmc_name_of_event(ev->pl_u.pl_a.pl_event, ps->ps_arch))
369 == NULL)
367 goto error;
368 break;
369 case PMCLOG_TYPE_PMCATTACH:
370 PMCLOG_GET_PATHLEN(pathlen,evlen,pmclog_pmcattach);
371 PMCLOG_READ32(le,ev->pl_u.pl_t.pl_pmcid);
372 PMCLOG_READ32(le,ev->pl_u.pl_t.pl_pid);
373 PMCLOG_READSTRING(le,ev->pl_u.pl_t.pl_pathname,pathlen);
374 break;

--- 198 unchanged lines hidden ---
370 goto error;
371 break;
372 case PMCLOG_TYPE_PMCATTACH:
373 PMCLOG_GET_PATHLEN(pathlen,evlen,pmclog_pmcattach);
374 PMCLOG_READ32(le,ev->pl_u.pl_t.pl_pmcid);
375 PMCLOG_READ32(le,ev->pl_u.pl_t.pl_pid);
376 PMCLOG_READSTRING(le,ev->pl_u.pl_t.pl_pathname,pathlen);
377 break;

--- 198 unchanged lines hidden ---