pfs_instr_class.cc | pfs_instr_class.cc | |||
---|---|---|---|---|
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reser ved. | /* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reser ved. | |||
This program is free software; you can redistribute it and/or modify | This program is free software; you can redistribute it and/or modify | |||
it under the terms of the GNU General Public License as published by | it under the terms of the GNU General Public License as published by | |||
the Free Software Foundation; version 2 of the License. | the Free Software Foundation; version 2 of the License. | |||
This program is distributed in the hope that it will be useful, | This program is distributed in the hope that it will be useful, | |||
but WITHOUT ANY WARRANTY; without even the implied warranty of | but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
GNU General Public License for more details. | GNU General Public License for more details. | |||
skipping to change at line 983 | skipping to change at line 983 | |||
return (index + 1); | return (index + 1); | |||
} | } | |||
file_class_lost++; | file_class_lost++; | |||
return 0; | return 0; | |||
} | } | |||
/** | /** | |||
Register a stage instrumentation metadata. | Register a stage instrumentation metadata. | |||
@param name the instrumented name | @param name the instrumented name | |||
@param prefix_length length in bytes of the name prefix | ||||
@param name_length length in bytes of name | @param name_length length in bytes of name | |||
@param flags the instrumentation flags | @param flags the instrumentation flags | |||
@return a stage instrumentation key | @return a stage instrumentation key | |||
*/ | */ | |||
PFS_stage_key register_stage_class(const char *name, uint name_length, | PFS_stage_key register_stage_class(const char *name, | |||
uint prefix_length, | ||||
uint name_length, | ||||
int flags) | int flags) | |||
{ | { | |||
/* See comments in register_mutex_class */ | /* See comments in register_mutex_class */ | |||
uint32 index; | uint32 index; | |||
PFS_stage_class *entry; | PFS_stage_class *entry; | |||
REGISTER_CLASS_BODY_PART(index, stage_class_array, stage_class_max, | REGISTER_CLASS_BODY_PART(index, stage_class_array, stage_class_max, | |||
name, name_length) | name, name_length) | |||
index= PFS_atomic::add_u32(&stage_class_dirty_count, 1); | index= PFS_atomic::add_u32(&stage_class_dirty_count, 1); | |||
if (index < stage_class_max) | if (index < stage_class_max) | |||
{ | { | |||
entry= &stage_class_array[index]; | entry= &stage_class_array[index]; | |||
init_instr_class(entry, name, name_length, flags, PFS_CLASS_STAGE); | init_instr_class(entry, name, name_length, flags, PFS_CLASS_STAGE); | |||
entry->m_prefix_length= prefix_length; | ||||
entry->m_event_name_index= index; | entry->m_event_name_index= index; | |||
entry->m_enabled= false; /* disabled by default */ | entry->m_enabled= false; /* disabled by default */ | |||
entry->m_timed= false; | entry->m_timed= false; | |||
/* Set user-defined configuration options for this instrument */ | /* Set user-defined configuration options for this instrument */ | |||
configure_instr_class(entry); | configure_instr_class(entry); | |||
PFS_atomic::add_u32(&stage_class_allocated_count, 1); | PFS_atomic::add_u32(&stage_class_allocated_count, 1); | |||
return (index + 1); | return (index + 1); | |||
} | } | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 6 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |