Merge commit 'refs/top-bases/linux-configure-branch' into linux-configure-branch

This commit is contained in:
Brian Behlendorf 2010-07-21 12:50:20 -07:00
commit 7474247231
4 changed files with 16 additions and 11 deletions

View File

@ -4431,7 +4431,7 @@ zpool_do_events_next(ev_opts_t *opts)
nvlist_t *nvl;
int ret, dropped;
(void) printf(gettext("%-27s %s\n"), "TIME", "CLASS");
(void) printf(gettext("%-30s %s\n"), "TIME", "CLASS");
while (1) {
ret = zpool_events_next(g_zfs, &nvl, &dropped, !!opts->follow);

View File

@ -496,9 +496,19 @@ fm_zevent_insert(zevent_t *ev)
void
fm_zevent_post(nvlist_t *nvl, nvlist_t *detector, zevent_cb_t *cb)
{
int64_t tv_array[2];
timestruc_t tv;
size_t nvl_size = 0;
zevent_t *ev;
gethrestime(&tv);
tv_array[0] = tv.tv_sec;
tv_array[1] = tv.tv_nsec;
if (nvlist_add_int64_array(nvl, FM_EREPORT_TIME, tv_array, 2)) {
atomic_add_64(&erpt_kstat_data.erpt_set_failed.value.ui64, 1);
return;
}
(void) nvlist_size(nvl, &nvl_size, NV_ENCODE_NATIVE);
if (nvl_size > ERPT_DATA_SZ || nvl_size == 0) {
atomic_add_64(&erpt_kstat_data.erpt_dropped.value.ui64, 1);
@ -892,8 +902,6 @@ fm_ereport_set(nvlist_t *ereport, int version, const char *erpt_class,
{
char ereport_class[FM_MAX_CLASS];
const char *name;
timestruc_t tv;
int64_t tv_array[2];
va_list ap;
int ret;
@ -925,13 +933,6 @@ fm_ereport_set(nvlist_t *ereport, int version, const char *erpt_class,
if (ret)
atomic_add_64(&erpt_kstat_data.erpt_set_failed.value.ui64, 1);
gethrestime(&tv);
tv_array[0] = tv.tv_sec;
tv_array[1] = tv.tv_nsec;
if (nvlist_add_int64_array(ereport, FM_EREPORT_TIME, tv_array, 2)) {
atomic_add_64(&erpt_kstat_data.erpt_set_failed.value.ui64, 1);
}
}
/*

View File

@ -67,6 +67,7 @@ extern "C" {
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_PATH "vdev_path"
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_DEVID "vdev_devid"
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_FRU "vdev_fru"
#define FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE "vdev_state"
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_GUID "parent_guid"
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_TYPE "parent_type"
#define FM_EREPORT_PAYLOAD_ZFS_PARENT_PATH "parent_path"

View File

@ -820,9 +820,12 @@ zfs_post_common(spa_t *spa, vdev_t *vd, const char *name)
VERIFY(nvlist_add_string(resource, FM_CLASS, class) == 0);
VERIFY(nvlist_add_uint64(resource,
FM_EREPORT_PAYLOAD_ZFS_POOL_GUID, spa_guid(spa)) == 0);
if (vd)
if (vd) {
VERIFY(nvlist_add_uint64(resource,
FM_EREPORT_PAYLOAD_ZFS_VDEV_GUID, vd->vdev_guid) == 0);
VERIFY(nvlist_add_uint64(resource,
FM_EREPORT_PAYLOAD_ZFS_VDEV_STATE, vd->vdev_state) == 0);
}
fm_zevent_post(resource, NULL, zfs_zevent_post_cb);
#endif