X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fsgen%2Fsgen-protocol-def.h;h=7406ab2c5b335e69e7e5973ca253803e5d17ba80;hb=ca0c2f51b70b960635032572548be1d9bc7f7581;hp=9f8f9bcd6eb9e82cf87c94235d7d3732dd6e6150;hpb=b16bcb6332458610a13bb749b277f042ade32de2;p=mono.git diff --git a/mono/sgen/sgen-protocol-def.h b/mono/sgen/sgen-protocol-def.h index 9f8f9bcd6eb..7406ab2c5b3 100644 --- a/mono/sgen/sgen-protocol-def.h +++ b/mono/sgen/sgen-protocol-def.h @@ -1,3 +1,20 @@ +/** + * \file + * All binary protocol entries are defined here. To keep compatibility with past binary + * protocol files, new protocol entries need to be defined at the end of the file so that + * the sequential numbering is preserved. We also can't change the types or numbers of + * arguments of existing entries. Instead, a new entry has to be added and the old entry + * retired - add a comment to make clear it's not used anymore, but it needs to stay in the + * definition file, both to preserve the numbering as well as for the benefit of + * `sgen-grep-binprot`, which will still want to read the old entries. + * + * It might become necessary to add a header protocol entry that includes version + * information. If/when we do that, we should also include word length and endianness. As + * of right now, binary protocol files don't identify themselves as 32 vs 64 bits or big- vs + * little-endian. At that point, `sgen-grep-binprot` should also be made able to read all + * combinations of files, regardless of the host. + */ + BEGIN_PROTOCOL_ENTRY3 (binary_protocol_collection_requested, TYPE_INT, generation, TYPE_SIZE, requested_size, TYPE_BOOL, force) DEFAULT_PRINT () IS_ALWAYS_MATCH (TRUE) @@ -96,7 +113,7 @@ MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTO IS_VTABLE_MATCH (FALSE) END_PROTOCOL_ENTRY_HEAVY -BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new) +BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_block_set_state, TYPE_POINTER, addr, TYPE_SIZE, size, TYPE_INT, old, TYPE_INT, new_) DEFAULT_PRINT () IS_ALWAYS_MATCH (FALSE) MATCH_INDEX (matches_interval (ptr, entry->addr, entry->size) ? 0 : BINARY_PROTOCOL_NO_MATCH) @@ -268,7 +285,7 @@ END_PROTOCOL_ENTRY BEGIN_PROTOCOL_ENTRY6 (binary_protocol_missing_remset, TYPE_POINTER, obj, TYPE_POINTER, obj_vtable, TYPE_INT, offset, TYPE_POINTER, value, TYPE_POINTER, value_vtable, TYPE_BOOL, value_pinned) DEFAULT_PRINT () IS_ALWAYS_MATCH (FALSE) -MATCH_INDEX (ptr == entry->obj ? 0 : ptr == entry->value ? 3 : ptr == (char*)entry->obj + entry->offset ? BINARY_PROTOCOL_MATCH : BINARY_PROTOCOL_NO_MATCH) +MATCH_INDEX (ptr == entry->obj ? 0 : ptr == entry->value ? 3 : ptr == entry->obj + entry->offset ? BINARY_PROTOCOL_MATCH : BINARY_PROTOCOL_NO_MATCH) IS_VTABLE_MATCH (ptr == entry->obj_vtable || ptr == entry->value_vtable) END_PROTOCOL_ENTRY @@ -315,7 +332,7 @@ IS_VTABLE_MATCH (FALSE) END_PROTOCOL_ENTRY_HEAVY BEGIN_PROTOCOL_ENTRY_HEAVY3 (binary_protocol_dislink_update, TYPE_POINTER, link, TYPE_POINTER, obj, TYPE_BOOL, track) -CUSTOM_PRINT(entry->obj ? printf ("link %p obj %p track %d", entry->link, entry->obj, entry->track) : printf ("link %p obj %p", entry->link, entry->obj)) +CUSTOM_PRINT(entry->obj ? printf ("link 0x%"MWORD_FORMAT_SPEC_P" obj 0x%"MWORD_FORMAT_SPEC_P" track %d", entry->link, entry->obj, entry->track) : printf ("link 0x%"MWORD_FORMAT_SPEC_P" obj 0x%"MWORD_FORMAT_SPEC_P, entry->link, entry->obj)) IS_ALWAYS_MATCH (FALSE) MATCH_INDEX (ptr == entry->link ? 0 : ptr == entry->obj ? 1 : BINARY_PROTOCOL_NO_MATCH) IS_VTABLE_MATCH (FALSE) @@ -356,6 +373,104 @@ MATCH_INDEX (ptr == entry->cursor ? 1 : ptr == entry->value ? 2 : BINARY_PROTOCO IS_VTABLE_MATCH (FALSE) END_PROTOCOL_ENTRY_HEAVY +BEGIN_PROTOCOL_ENTRY_HEAVY4 (binary_protocol_mod_union_remset, TYPE_POINTER, obj, TYPE_POINTER, ptr, TYPE_POINTER, value, TYPE_POINTER, value_vtable) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (FALSE) +MATCH_INDEX (ptr == entry->obj ? 0 : ptr == entry->ptr ? 1 : ptr == entry->value ? 2 : BINARY_PROTOCOL_NO_MATCH) +IS_VTABLE_MATCH (ptr == entry->value_vtable) +END_PROTOCOL_ENTRY_HEAVY + +BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_major_card_table_scan_start, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY_HEAVY + +BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_major_card_table_scan_end, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY_HEAVY + +BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_los_card_table_scan_start, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY_HEAVY + +BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_los_card_table_scan_end, TYPE_LONGLONG, timestamp, TYPE_BOOL, mod_union) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY_HEAVY + +BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_finish_gray_stack_start, TYPE_LONGLONG, timestamp, TYPE_INT, generation) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY_HEAVY + +BEGIN_PROTOCOL_ENTRY_HEAVY2 (binary_protocol_finish_gray_stack_end, TYPE_LONGLONG, timestamp, TYPE_INT, generation) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY_HEAVY + +BEGIN_PROTOCOL_ENTRY2 (binary_protocol_worker_finish, TYPE_LONGLONG, timestamp, TYPE_BOOL, forced) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY + +BEGIN_PROTOCOL_ENTRY1 (binary_protocol_evacuating_blocks, TYPE_SIZE, block_size) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY + +BEGIN_PROTOCOL_ENTRY1 (binary_protocol_concurrent_sweep_end, TYPE_LONGLONG, timestamp) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY + +BEGIN_PROTOCOL_ENTRY4 (binary_protocol_header, TYPE_LONGLONG, check, TYPE_INT, version, TYPE_INT, ptr_size, TYPE_BOOL, little_endian) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY_FLUSH + +BEGIN_PROTOCOL_ENTRY4 (binary_protocol_pin_stats, TYPE_INT, objects_pinned_in_nursery, TYPE_SIZE, bytes_pinned_in_nursery, TYPE_INT, objects_pinned_in_major, TYPE_SIZE, bytes_pinned_in_major) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY + +BEGIN_PROTOCOL_ENTRY6 (binary_protocol_worker_finish_stats, TYPE_INT, worker_index, TYPE_INT, generation, TYPE_BOOL, forced, TYPE_LONGLONG, major_scan, TYPE_LONGLONG, los_scan, TYPE_LONGLONG, work_time) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY + +BEGIN_PROTOCOL_ENTRY3 (binary_protocol_collection_end_stats, TYPE_LONGLONG, major_scan, TYPE_LONGLONG, los_scan, TYPE_LONGLONG, finish_stack) +DEFAULT_PRINT () +IS_ALWAYS_MATCH (TRUE) +MATCH_INDEX (BINARY_PROTOCOL_MATCH) +IS_VTABLE_MATCH (FALSE) +END_PROTOCOL_ENTRY + #undef BEGIN_PROTOCOL_ENTRY0 #undef BEGIN_PROTOCOL_ENTRY1 #undef BEGIN_PROTOCOL_ENTRY2