185 NULL, /* fmdo_gc */
186 };
187
188 void
189 self_init(fmd_hdl_t *hdl)
190 {
191 fmd_module_t *mp = (fmd_module_t *)hdl; /* see below */
192
193 fmd_hdl_info_t info = {
194 "Fault Manager Self-Diagnosis", "1.0", &self_ops, NULL
195 };
196
197 /*
198 * Unlike other modules, fmd-self-diagnosis has some special needs that
199 * fall outside of what we want in the module API. Manually disable
200 * checkpointing for this module by tweaking the mod_stats values.
201 * The self-diagnosis world relates to fmd's running state and modules
202 * which all change when it restarts, so don't bother w/ checkpointing.
203 */
204 (void) pthread_mutex_lock(&mp->mod_stats_lock);
205 mp->mod_stats->ms_ckpt_save.fmds_value.bool = FMD_B_FALSE;
206 mp->mod_stats->ms_ckpt_restore.fmds_value.bool = FMD_B_FALSE;
207 (void) pthread_mutex_unlock(&mp->mod_stats_lock);
208
209 if (fmd_hdl_register(hdl, FMD_API_VERSION, &info) != 0)
210 return; /* failed to register with fmd */
211
212 (void) fmd_stat_create(hdl, FMD_STAT_NOALLOC, sizeof (self_stats) /
213 sizeof (fmd_stat_t), (fmd_stat_t *)&self_stats);
214 }
215
216 void
217 self_fini(fmd_hdl_t *hdl)
218 {
219 fmd_case_t *cp = NULL;
220
221 while ((cp = fmd_case_next(hdl, cp)) != NULL)
222 self_case_destroy(hdl, fmd_case_getspecific(hdl, cp));
223 }
|
185 NULL, /* fmdo_gc */
186 };
187
188 void
189 self_init(fmd_hdl_t *hdl)
190 {
191 fmd_module_t *mp = (fmd_module_t *)hdl; /* see below */
192
193 fmd_hdl_info_t info = {
194 "Fault Manager Self-Diagnosis", "1.0", &self_ops, NULL
195 };
196
197 /*
198 * Unlike other modules, fmd-self-diagnosis has some special needs that
199 * fall outside of what we want in the module API. Manually disable
200 * checkpointing for this module by tweaking the mod_stats values.
201 * The self-diagnosis world relates to fmd's running state and modules
202 * which all change when it restarts, so don't bother w/ checkpointing.
203 */
204 (void) pthread_mutex_lock(&mp->mod_stats_lock);
205 mp->mod_stats->ms_ckpt_save.fmds_value.b = FMD_B_FALSE;
206 mp->mod_stats->ms_ckpt_restore.fmds_value.b = FMD_B_FALSE;
207 (void) pthread_mutex_unlock(&mp->mod_stats_lock);
208
209 if (fmd_hdl_register(hdl, FMD_API_VERSION, &info) != 0)
210 return; /* failed to register with fmd */
211
212 (void) fmd_stat_create(hdl, FMD_STAT_NOALLOC, sizeof (self_stats) /
213 sizeof (fmd_stat_t), (fmd_stat_t *)&self_stats);
214 }
215
216 void
217 self_fini(fmd_hdl_t *hdl)
218 {
219 fmd_case_t *cp = NULL;
220
221 while ((cp = fmd_case_next(hdl, cp)) != NULL)
222 self_case_destroy(hdl, fmd_case_getspecific(hdl, cp));
223 }
|