Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1283073ybi; Fri, 14 Jun 2019 11:47:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+pFWAumHvGsTo9lB7WldGhlC67ZQlfyLOXix5ATS6AVjP4bIwIhUI3PAIveSnuzb6VLGj X-Received: by 2002:a17:902:2865:: with SMTP id e92mr93495252plb.264.1560538039098; Fri, 14 Jun 2019 11:47:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560538039; cv=none; d=google.com; s=arc-20160816; b=Te74bzBipCs5DhWIHF2MmyTIdp8R251fa0KD/Sw/jQ5QfiU1i3zFGX3SHUepk0W1/R YbHuUvPcxnHFY1arihyXm4FFYWY84jK9mLu4Yp85/Zf6LdsyR/BvuGmGtFL6SLp8bh9+ MQ/ZJzti0fEfAPiqhwY213b0SPZX0rx95L7Mtq9XI3jipf/Hon3p+a8uEfezc+v/3LsB KZgVlJr5Ie+eBpYds+d0fYbw//4PcBxk/lKvpvAfMtKaL6hemtFGM7OGFuHqh2Cph1Lv jQWDIChLf93Xk6yGRqqim7BggJW5Mt01gF/7x+auvq9MaSHnwqLj3FKSN3S3H68IheKF Uu8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:to:from:subject:message-id; bh=rH6b7Ucl2bQTpZuYU3kP9De72NDibbzzWkrl97xCRag=; b=ggxU8P5WhY2Q/dsgzKtPjp8oH4bC5uZJY2egBv0/avP5AeLx62yNNEXYwKqlYZ3XfE SxarTs1nPy/O+GB5Owg5lr4Qhe3uxtXTH5nZbtCFEw2gf76dZDBfnnot5oTmBOjHRLQu 8B6lUk5nL6n71/AkGEWwCjpBIZ2dsQMGgS707Wh4Vo5+qG63DvAJ3qboPsGyPIWfkEts LVdAjGSbEJqyGa1HdXyBunbkG/OdCMcXxWaY5nHC1vF4PMfEeA8rYKOihdbwKQjPDk83 ojZtlN5zFBAS8v3XwhUEJ3h+aZ19qPlnF6/AbSc/dS6ZTaRbuFp8wyXMhoV3UW/AP6vV g2BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18si2805311pls.437.2019.06.14.11.47.04; Fri, 14 Jun 2019 11:47:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725889AbfFNSq7 (ORCPT + 99 others); Fri, 14 Jun 2019 14:46:59 -0400 Received: from s3.sipsolutions.net ([144.76.43.62]:48038 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbfFNSq7 (ORCPT ); Fri, 14 Jun 2019 14:46:59 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1hbrDm-0000jX-4d; Fri, 14 Jun 2019 20:46:42 +0200 Message-ID: <231c9afd2aaca99c89bc73954307a28a60e86d18.camel@sipsolutions.net> Subject: Re: [PATCH-v3 1/2] wireless: Support assoc-at-ms timer in sta-info From: Johannes Berg To: Ben Greear , linux-wireless@vger.kernel.org Date: Fri, 14 Jun 2019 20:46:40 +0200 In-Reply-To: <7d606df7-bb8e-c454-1eaf-24fd454eab8e@candelatech.com> References: <20190415172123.6532-1-greearb@candelatech.com> <21fa668485f4eb0a8056aac1797854f267d5f1e0.camel@sipsolutions.net> <3ad69c55-2b88-a96b-d21e-99f4418466ee@candelatech.com> <7d606df7-bb8e-c454-1eaf-24fd454eab8e@candelatech.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2019-06-14 at 08:14 -0700, Ben Greear wrote: > > > So, maybe I return instead the elapsed time in the netlink API instead of a > timestamp. I think that will give me the value that I am looking for, > and I can still print out the 'real' time in iw so any tools reading that > output and do some simple math and figure out the 'real' associated-at time. I don't think that's good. There's a delay between filling the message and then processing it in userspace. We had this in the scan code and learned that was full of races. The better thing is to use CLOCK_BOOTTIME nanoseconds, and then userspace can use clock_gettime() to get the current time etc. and then do whatever calculations it needs. If it wants to print the realtime timestamp, it could even calculate that (with some jitter) by doing clock_gettime() on both realtime and boottime clocks... johannes