2 *------------------------------------------------------------------
3 * Copyright (c) 2006-2016 Cisco and/or its affiliates.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __cpel_util_h__
18 #define __cpel_util_h__
21 * Our idea of an event, as opposed to a CPEL event
33 * Track object, so we can sort the tracks alphabetically and
34 * fix the events later
36 typedef struct track_ {
44 event_definition_t *the_event_definitions;
47 /* Hash tables, used to find previous instances of the same items */
48 uword *the_track_hash;
49 uword *the_msg_event_hash;
50 uword *the_strtab_hash;
51 uword *the_pidtid_hash;
52 uword *the_pid_to_name_hash;
55 u32 find_or_add_strtab(void *s_arg);
56 u32 find_or_add_track(void *s_arg);
57 u32 find_or_add_event(void *s_arg, char *datum_format);
58 int write_string_table(FILE *ofp);
59 int write_cpel_header(FILE *ofp, u32 nsections);
60 int write_event_defs(FILE *ofp);
62 int write_events(FILE *ofp, u64 clock_ticks_per_second);
63 int write_track_defs(FILE *ofp);
64 void cpel_util_init (void);
65 void alpha_sort_tracks(void);
66 void fixup_event_tracks(void);
68 #endif /* __cpel_util_h__ */