Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9187a415 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki
Browse files

ACPICA: Add new statistics interface.



This patch ports new counters and statistics interface, already
implemented in ACPICA upstream, to Linux.  That helps to reduce
source code differences between Linux and ACPICA upstream.

[rjw: Changelog]
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent fa5f508f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -406,7 +406,9 @@ extern u32 acpi_gbl_nesting_level;

/* Event counters */

ACPI_EXTERN u32 acpi_method_count;
ACPI_EXTERN u32 acpi_gpe_count;
ACPI_EXTERN u32 acpi_sci_count;
ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS];

/* Support for dynamic control method tracing mechanism */
+1 −0
Original line number Diff line number Diff line
@@ -292,6 +292,7 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
	 * reentered one more time (even if it is the same thread)
	 */
	obj_desc->method.thread_count++;
	acpi_method_count++;
	return_ACPI_STATUS(status);

cleanup:
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ static u32 ACPI_SYSTEM_XFACE acpi_ev_sci_xrupt_handler(void *context)

	interrupt_handled |= acpi_ev_sci_dispatch();

	acpi_sci_count++;
	return_UINT32(interrupt_handled);
}

+12 −0
Original line number Diff line number Diff line
@@ -289,6 +289,16 @@ acpi_status acpi_ut_init_globals(void)

	acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;

	/* Event counters */

	acpi_method_count = 0;
	acpi_sci_count = 0;
	acpi_gpe_count = 0;

	for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++) {
		acpi_fixed_event_count[i] = 0;
	}

#if (!ACPI_REDUCED_HARDWARE)

	/* GPE/SCI support */
@@ -383,4 +393,6 @@ ACPI_EXPORT_SYMBOL(acpi_dbg_level)

ACPI_EXPORT_SYMBOL(acpi_dbg_layer)

ACPI_EXPORT_SYMBOL(acpi_gpe_count)

ACPI_EXPORT_SYMBOL(acpi_current_gpe_count)
+38 −0
Original line number Diff line number Diff line
@@ -208,6 +208,44 @@ acpi_status acpi_get_system_info(struct acpi_buffer * out_buffer)

ACPI_EXPORT_SYMBOL(acpi_get_system_info)

/*******************************************************************************
 *
 * FUNCTION:    acpi_get_statistics
 *
 * PARAMETERS:  stats           - Where the statistics are returned
 *
 * RETURN:      status          - the status of the call
 *
 * DESCRIPTION: Get the contents of the various system counters
 *
 ******************************************************************************/
acpi_status acpi_get_statistics(struct acpi_statistics *stats)
{
	ACPI_FUNCTION_TRACE(acpi_get_statistics);

	/* Parameter validation */

	if (!stats) {
		return_ACPI_STATUS(AE_BAD_PARAMETER);
	}

	/* Various interrupt-based event counters */

	stats->sci_count = acpi_sci_count;
	stats->gpe_count = acpi_gpe_count;

	ACPI_MEMCPY(stats->fixed_event_count, acpi_fixed_event_count,
		    sizeof(acpi_fixed_event_count));

	/* Other counters */

	stats->method_count = acpi_method_count;

	return_ACPI_STATUS(AE_OK);
}

ACPI_EXPORT_SYMBOL(acpi_get_statistics)

/*****************************************************************************
 *
 * FUNCTION:    acpi_install_initialization_handler
Loading