The fault diagnosis module is a key component integrated in active fault-tolerant control systems. However, the classical methods usually design fault diagnosis and control modules, separately, which ignore the existing interactions between the two key modules in active fault-tolerant control systems. In order to deal with this problem, this paper establishes a framework for integrated design of active fault diagnosis (AFD) and control while ensuring the performance of tracking control. In particular, the input is designed to balance the goal of AFD with the reference output tracking performance. The design of inputs is formulated to minimize the sum of a quadratic function and a non-convex quadratic fractional function at each step, whose global optimality can be obtained under the tight condition of convex relaxation. Furthermore, despite the global optimal condition is not achieved, a locally optimal solution could still be obtained by using our proposed local linearization search algorithm, whose suboptimality can be strictly guaranteed theoretically. At the end, a practical four-tank system example is used to verify the effectiveness of our proposed method.