Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268877AbUI2Thg (ORCPT ); Wed, 29 Sep 2004 15:37:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268854AbUI2ThW (ORCPT ); Wed, 29 Sep 2004 15:37:22 -0400 Received: from omx2-ext.sgi.com ([192.48.171.19]:25545 "EHLO omx2.sgi.com") by vger.kernel.org with ESMTP id S268877AbUI2Td0 (ORCPT ); Wed, 29 Sep 2004 15:33:26 -0400 Date: Wed, 29 Sep 2004 12:32:09 -0700 (PDT) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: George Anzinger cc: Ulrich Drepper , johnstul@us.ibm.com, Ulrich.Windl@rz.uni-regensburg.de, jbarnes@sgi.com, linux-kernel@vger.kernel.org, libc-alpha@sources.redhat.com Subject: Posix compliant CLOCK_PROCESS/THREAD_CPUTIME_ID V5 In-Reply-To: <415AF4C3.1040808@mvista.com> Message-ID: References: <4154F349.1090408@redhat.com> <41550B77.1070604@redhat.com> <4159B920.3040802@redhat.com> <415AF4C3.1040808@mvista.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1700579579-76263974-1096486329=:25905" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 16090 Lines: 276 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1700579579-76263974-1096486329=:25905 Content-Type: TEXT/PLAIN; charset=US-ASCII This version uses an offset field in the task and signal structs to store offsets for the thread and process clock. It also includes the check in timer_create for REALTIME or MONOTONIC. The clocks are now independent and therefore the thread clock is not clearedby clock_settime(CLOCK_PROCESS_CPUTIME_ID) in the testrun: Single Thread Testing CLOCK_THREAD_CPUTIME_ID= 0.374943000 resolution= 0.000999848 CLOCK_PROCESS_CPUTIME_ID= 0.374943000 resolution= 0.000999848 Multi Thread Testing Starting Thread: 0 1 2 3 4 5 6 7 8 9 Joining Thread: 0 1 2 3 4 5 6 7 8 9 0 Cycles= 0 Thread= 0.000000000ns Process= 0.000999848ns 1 Cycles=1000000 Thread= 0.036994376ns Process= 0.315951968ns 2 Cycles=2000000 Thread= 0.073988752ns Process= 0.086986776ns 3 Cycles=3000000 Thread= 0.109983280ns Process= 0.517921264ns 4 Cycles=4000000 Thread= 0.146977656ns Process= 0.563914272ns 5 Cycles=5000000 Thread= 0.180972488ns Process= 1.043841312ns 6 Cycles=6000000 Thread= 0.218966712ns Process= 1.112830824ns 7 Cycles=7000000 Thread= 0.254961240ns Process= 1.620753608ns 8 Cycles=8000000 Thread= 0.290955768ns Process= 1.490773368ns 9 Cycles=9000000 Thread= 0.326950296ns Process= 1.641750416ns Clock status at the end of the timer tests: Gettimeofday() = 1096484938.561351000 CLOCK_REALTIME= 1096484938.561363000 resolution= 0.000999848 CLOCK_MONOTONIC= 157.633669432 resolution= 0.000999848 CLOCK_PROCESS_CPUTIME_ID= 1.641750416 resolution= 0.000999848 CLOCK_THREAD_CPUTIME_ID= 0.375942848 resolution= 0.000999848 ---1700579579-76263974-1096486329=:25905 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=thread_process_time_v5 Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: V5 of patch Content-Disposition: attachment; filename=thread_process_time_v5 SW5kZXg6IGxpbnV4LTIuNi45LXJjMi9rZXJuZWwvcG9zaXgtdGltZXJzLmMN Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSBsaW51eC0yLjYuOS1yYzIu b3JpZy9rZXJuZWwvcG9zaXgtdGltZXJzLmMJMjAwNC0wOS0xMiAyMjozMjo0 OC4wMDAwMDAwMDAgLTA3MDANCisrKyBsaW51eC0yLjYuOS1yYzIva2VybmVs L3Bvc2l4LXRpbWVycy5jCTIwMDQtMDktMjkgMTE6NDg6NTQuMDAwMDAwMDAw IC0wNzAwDQp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w3 IEBADQogDQogCS8qIFBPU0lYLjFiIEludGVydmFsIFRpbWVycyAqLw0KIAlz dHJ1Y3QgbGlzdF9oZWFkIHBvc2l4X3RpbWVyczsNCisJaW50CQkJcHJvY2Vz c19jbG9ja19vZmZzZXQ7CS8qIGZvciBDTE9DS19QUk9DRVNTX0NQVVRJTUVf SUQgKi8NCiANCiAJLyogam9iIGNvbnRyb2wgSURzICovDQogCXBpZF90IHBn cnA7DQpAQCAtNTA5LDYgKzUxMCw3IEBADQogCXVuc2lnbmVkIGxvbmcgdXRp bWUsIHN0aW1lOw0KIAl1bnNpZ25lZCBsb25nIG52Y3N3LCBuaXZjc3c7IC8q IGNvbnRleHQgc3dpdGNoIGNvdW50cyAqLw0KIAl1NjQgc3RhcnRfdGltZTsN CisJaW50IHRocmVhZF9jbG9ja19vZmZzZXQ7CS8qIG9mZnNldCB0byB0aHJl YWRfY2xvY2sgZm9yIENMT0NLX1RIUkVBRF9DUFVUSU1FX0lEICovDQogLyog bW0gZmF1bHQgYW5kIHN3YXAgaW5mbzogdGhpcyBjYW4gYXJndWFibHkgYmUg c2VlbiBhcyBlaXRoZXIgbW0tc3BlY2lmaWMgb3IgdGhyZWFkLXNwZWNpZmlj ICovDQogCXVuc2lnbmVkIGxvbmcgbWluX2ZsdCwgbWFqX2ZsdDsNCiAvKiBw cm9jZXNzIGNyZWRlbnRpYWxzICovDQo= ---1700579579-76263974-1096486329=:25905 Content-Type: TEXT/x-csrc; charset=US-ASCII; name="test_cputime.c" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Test program Content-Disposition: attachment; filename="test_cputime.c" I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8c3RkbGliLmg+DQojaW5j bHVkZSA8dGltZS5oPg0KI2luY2x1ZGUgPGVycm5vLmg+DQojaW5jbHVkZSA8 YXNtL3VuaXN0ZC5oPg0KI2luY2x1ZGUgPHB0aHJlYWQuaD4NCg0KI2RlZmlu ZSBjbG9ja19nZXRyZXM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700579579-76263974-1096486329=:25905-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/